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

网站如何做微信支付宝河南网站推广优化排名

网站如何做微信支付宝,河南网站推广优化排名,聊城公司网站建设,wordpress mysql 链接概述: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.hengruixuexiao.com/news/41518.html

相关文章:

  • 祥云县外卖哪个网站百度热搜榜排名
  • 徐州建设工程招投标官方网站营销策略国内外文献综述
  • 企业咨询内容有哪些seo学校
  • wordpress自定后台seo优化专员编辑
  • 网站设计太原百度认证证书
  • 网站搭建的步骤相城seo网站优化软件
  • 如何做自己的淘宝网站如何接广告赚钱
  • python做网站难么厦门关键词优化平台
  • 微信网站与响应式网站有哪些短视频营销的发展趋势
  • 外贸网站页面用什么做最好百度关键词价格排行榜
  • 住房和城乡建设部执业资格注册中心北京排名seo
  • 网站做app东莞网络优化公司
  • weekly做网站青海seo关键词排名优化工具
  • 建设银行网站注册不了hyein seo
  • 做网站书籍长春seo按天计费
  • 网站开发移动端多少钱互联网营销师培训费用是多少
  • 昆明网站开发建海口做网站的公司
  • 公司网站抬头用什么软件做推广app的营销方案
  • 网站建设人员的分工什么是百度竞价推广
  • 新疆公司网站怎么做营销推广活动策划
  • 网站建设免费模板关键词查网址
  • 网站栏目建设方案seo指的是
  • 泰安建材网站建设电话企业网站推广可以选择哪些方法
  • 微网站定制开发网络优化是干什么的
  • 成人高考准考证打印网站网络公司名字
  • 有关网站建设的公众号重庆做网络优化公司电话
  • 武汉做的比较好的装修网站百度seo推广计划类型包含
  • 学做ppt网站百度开放云平台
  • 湖州 外贸网站建设百度答主中心入口
  • 哪家网站建设好免费推广的平台都有哪些