---------- Forwarded message ---------- From: Yann Ylavic <[email protected]> Date: Wed, Apr 30, 2014 at 11:59 AM Subject: Re: apr_socket_opt_set always sets TCP_DEFER_ACCEPT to 1 To: APR Developer List <[email protected]>
On Tue, Apr 29, 2014 at 5:41 PM, Jim Jagielski <[email protected]> wrote: > > On Apr 22, 2014, at 9:43 AM, Brian J. France <[email protected]> wrote: >> >> For some reason I completely missed that. APR is fine, but httpd needs >> updated as it is hard coded to 1: >> >> rv = apr_socket_opt_set(s, APR_TCP_DEFER_ACCEPT, 1); >> >> Will move to the httpd list. > > > Did I miss this on dev@httpd? I seems that httpd trunk and 2.4.x use "apr_socket_opt_set(s, APR_TCP_DEFER_ACCEPT, 30);" whereas 2.2.x uses a value of 1. This come from PR http://issues.apache.org/bugzilla/show_bug.cgi?id=41270, commit http://svn.apache.org/viewvc?view=revision&revision=501364, which since then has been forked to 2.4.x, and never merged in 2.2.x. Linux (code and mostly comment) is quite clear on the setsockopt() value. In master/net/ipv4/tcp.c::do_tcp_setsockopt() : case TCP_DEFER_ACCEPT: /* Translate value in seconds to number of retransmits */ icsk->icsk_accept_queue.rskq_defer_accept = secs_to_retrans(val, TCP_TIMEOUT_INIT / HZ, TCP_RTO_MAX / HZ); break; One second is too low imo (cf. PR above).
