openresty 中nginx默认配置是否开启keepalive_timeout 属性,如果开启后是否会增加服务器压力!?
还有个问题,nginx的配置中keepalive和keepalive_timeout有什么区别??On Monday, October 20, 2014 7:46:32 PM UTC+8, Tim Yang wrote:openresty 中nginx默认配置是否开启keepalive_timeout 属性,如果开启后是否会增加服务器压力!? --
Hello! On Mon, Oct 20, 2014 at 4:46 AM, Tim Yang wrote: > openresty 中nginx默认配置是否开启keepalive_timeout 属性,如果开启后是否会增加服务器压力!? > openresty 中的 nginx 核心几乎就是官方的 nginx 核心(除了一些尚未合入官方 nginx 的 bug 修复和极少数无关痛痒的新功能),因此 keepalive_timeout 的默认值就是 nginx 官方的默认值,见 http://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_timeout 是否启用长连接取决于具体的应用场景和流量特征。适合的时候会降低服务器压力,不适合的时候反而会提高。 > 还有个问题,nginx的配置中keepalive和keepalive_timeout有什么区别?? > 前者作用于上游连接(或者说后端连接),而后者作用于下游连接(即客户端连接)。 请参见 nginx 官方的文档: http://nginx.org/en/docs/http/ngx_http_upstream_module.html#keepalive http://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_timeout Regards, -agentzh