# HG changeset patch # User Ruslan Ermilov # Date 1323155947 0 # Node ID 09b8c8b2b865e21f73e37afc7860807d7894cfde # Parent bfe3eff81d04d3f34bf4aafd88180825639058b2 Documented the "so_keepalive" parameter of the "listen" directive. diff -r bfe3eff81d04 -r 09b8c8b2b865 xml/en/docs/http/ngx_http_core_module.xml --- a/xml/en/docs/http/ngx_http_core_module.xml Mon Dec 05 07:50:10 2011 +0000 +++ b/xml/en/docs/http/ngx_http_core_module.xml Tue Dec 06 07:19:07 2011 +0000 @@ -928,7 +928,7 @@ [bind] [ipv6only=on|off] [ssl] - + [so_keepalive=on|off|[keepidle]:[keepintvl]:[keepcnt]] port [default_server] @@ -941,7 +941,7 @@ [bind] [ipv6only=on|off] [ssl] - + [so_keepalive=on|off|[keepidle]:[keepintvl]:[keepcnt]] unix:path [default_server] @@ -952,7 +952,7 @@ [deferred] [bind] [ssl] - + [so_keepalive=on|off|[keepidle]:[keepintvl]:[keepcnt]] *:80 | *:8000 server @@ -1087,8 +1087,9 @@ system call will be made to determine an address that accepted a connection. If parameters backlog, rcvbuf, -sndbuf, accept_filter, or -deferred are used then for a given +sndbuf, accept_filter, +deferred, or so_keepalive +are used then for a given address:port pair a separate bind call will always be made. @@ -1118,6 +1119,33 @@ + +so_keepalive=on|off|[keepidle]:[keepintvl]:[keepcnt] + + +this parameter (1.1.11) configures the “TCP keepalive” behavior +for the listening socket. +If this parameter is omitted then the system default setting will be +in effect for the socket. +If set to the value “on”, the SO_KEEPALIVE +socket option is turned on for the socket. +If set to the value “off”, the SO_KEEPALIVE +socket option is turned off for the socket. +Some operating systems support tuning TCP keepalive parameters on a per-socket +basis using the TCP_KEEPIDLE, TCP_KEEPINTVL, +and TCP_KEEPCNT socket options. +On such systems (currently, Linux 2.4+ and NetBSD 5+) they can be configured +using the keepidle, keepintvl, and +keepcnt arguments. +One or two arguments may be omitted, in which case the system default setting +for the corresponding socket option will be in effect. +For example, +so_keepalive=30m::10 +will set idle timeout (TCP_KEEPIDLE) to 30 minutes, +leave probe interval (TCP_KEEPINTVL) at its system default, +and set probes count (TCP_KEEPCNT) to 10 probes. + +