On Apr 30, 2014, at 6:54 AM, Yann Ylavic <[email protected]> wrote:
> ---------- 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). Yes, 1 is way to low, even 60 doesn't help us with the RHEL 6 kernel bug. I am trying to get time to work on a patch that would allow something like this: AcceptFilter data:60 for 2.2.x. That is the only way I can see to allow tweaking the time and staying binary compatible with 2.2.x. Original thought was to change AcceptFilter to a AP_INIT_TAKE23 and add a accf_opt_map table, but that would change the conf struct size and break binary compatibility for 2.2.x. Brian
