当前位置: 首页 > news >正文

Java做新闻网站八种营销模式

Java做新闻网站,八种营销模式,能源与动力工程,上海高端网站建设服务公概述:web软件项目工程实施过程,经常会用到客户端和服务端建立 KeepAlive 长连接来提高应用效率的场景。例如:移动端应用或者复杂的网页交互需要在用户浏览时频繁地向服务端发送请求。但是随之而来的问题是,需要对服务器端 tomcat …

概述:web软件项目工程实施过程,经常会用到客户端和服务端建立 KeepAlive 长连接来提高应用效率的场景。例如:移动端应用或者复杂的网页交互需要在用户浏览时频繁地向服务端发送请求。但是随之而来的问题是,需要对服务器端 tomcat 的 KeepAlive 相关参数做配置,才能保证宝贵的服务器资源不会浪费或被别有用心的人利用,同时提高系统性能。

spring-boot 的自动装配插件 spring-boot-autoconfigure 的元数据文件 spring-configuration-metadata.json 中已经内嵌了一些默认的 tomcat 配置:

默认情况下,

连接数超过 10000 后会出现拒绝连接的情况。

触发的客户端请求超过 300 后拒绝响应。

    {"sourceType": "org.springframework.boot.autoconfigure.web.ServerProperties$Tomcat","defaultValue": 100,"name": "server.tomcat.accept-count","description": "Maximum queue length for incoming connection requests when all possible request processing threads are in use.","type": "java.lang.Integer"},
...{"sourceType": "org.springframework.boot.autoconfigure.web.ServerProperties$Tomcat","defaultValue": 10000,"name": "server.tomcat.max-connections","description": "Maximum number of connections that the server accepts and processes at any given time. Once the limit has been reached, the operating system may still accept connections based on the \"acceptCount\" property.","type": "java.lang.Integer"},
...   {"sourceType": "org.springframework.boot.autoconfigure.web.ServerProperties$Tomcat","defaultValue": 200,"name": "server.tomcat.max-threads","description": "Maximum number of worker threads.","type": "java.lang.Integer"},
... {"sourceType": "org.springframework.boot.autoconfigure.web.ServerProperties$Tomcat","defaultValue": 10,"name": "server.tomcat.min-spare-threads","description": "Minimum number of worker threads.","type": "java.lang.Integer"},

但是与 KeepAlive 相关的内嵌 tomcat 配置属性需要定制化开发

// bean被加载后 作用相当于Spring容器内的TomcatEmbeddedServletContainerFactory
@Component
public class WebServerConfiguration implements WebServerFactoryCustomizer<ConfigurableWebServerFactory> {@Overridepublic void customize(ConfigurableWebServerFactory configurableWebServerFactory) {// spring装配工厂类提供了自定义tomcat连接器配置的接口((TomcatServletWebServerFactory)configurableWebServerFactory).addConnectorCustomizers(new TomcatConnectorCustomizer() {@Overridepublic void customize(Connector connector) {Http11NioProtocol protocol = (Http11NioProtocol) connector.getProtocolHandler();// 30秒内没有请求 服务端自动断开 KeepAlive 链接protocol.setKeepAliveTimeout(30000);// 客户端发送超过10000个请求后自动断开 KeepAlive 链接protocol.setMaxKeepAliveRequests(10000);}});}
}

http://www.hkea.cn/news/41752/

相关文章:

  • 怎么查公司网站有没有被收录火爆产品的推广文案
  • 绵阳网站建设 经开区网络教学平台
  • wordpress阅读量没改7个湖北seo网站推广策略
  • 网站建设成功案例方案找培训机构的平台
  • 园林绿化网站建设百度关键词优化公司
  • 个人如何建设网站网络营销方式有哪些分类
  • 北京做百度网站建设电商平台如何推广运营
  • 电脑个人网站怎么做网络销售新手入门
  • 海口网站建设 小黄网络手机百度搜索
  • 太原百度网站建设网站应该如何进行优化
  • 烟台市做网站uc浏览网页版进入
  • 工程信息网站哪家做的较好提高工作效率心得体会
  • 建站平台入口徐州网站设计
  • 出口手工艺品网站建设方案站长统计app下载
  • 提升学历骗局武汉搜索引擎排名优化
  • wordpress+park主题上海全国关键词排名优化
  • 潍坊最早做网站的公司短链接生成网址
  • 东莞化工网站建设爱站网ip反域名查询
  • 做网站赚钱 2017哈尔滨关键词排名工具
  • 建设的网站首页微信怎么做推广
  • 建设网站导航百度信息流推广和搜索推广
  • 深圳室内设计公司招聘信息流广告优化
  • 旅游网站首页四种营销模式
  • 负责网站建设如何在百度发广告推广
  • 联通的网站是谁做的营销的主要目的有哪些
  • 衡阳微信网站地推的方法和技巧
  • 南阳做网站公司哪家好自动发外链工具
  • 潍坊网站制作最低价格网络营销案例有哪些
  • 做网站有谁做谷歌seo视频教程
  • 资深的网站推广完美日记网络营销策划书