You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Arthur Kreitman <ar...@congruent.com> on 2006/11/20 18:50:29 UTC

[users@httpd] Tuning the MaxKeepAliveRequests and KeepAliveTimeout http.conf parameters

This is for an isapi app on apache 2.2 using the broken 416293 mod_isapi
update on Windows XP.

 

I noticed a random but all to frequent (perhaps 1 or 2 or 3 for every
few hundred http requests) error from ap_core_output_filter (about line
903 in core_filters.c).   The error is an os 10054 "An existing
connection was forcibly closed by the remote host".   At the same time,
the client side would believe the server performed a premature socket
close.  

 

I've discovered that I can change the frequency of this error by
manipulating the MaxKeepAliveRequests and KeepAliveTimeout parameters.

 

Regardless of the value of KeepAliveTimeout, if I set
MaxKeepAliveRequests to 1 (ie no keep alive) the error occurs for almost
80% or 90% of the http requests

 

If I don't set MaxKeepAliveRequests, which then uses the default value,
by setting KeepAliveTimeout between 60 and 90 seconds, the error
disappears.

 

My understanding of KeepAliveTimeout is that it plays with the socket
linger option.   What are the side effects of setting KeepAliveTimeout
to a high value?   What are the side effects of setting
MaxKeepAliveRequests to a high value?

 

Thanks

 

Art

 

 


RE: [users@httpd] Tuning the MaxKeepAliveRequests and KeepAliveTimeout http.conf parameters

Posted by Arthur Kreitman <ar...@congruent.com>.
And what about bad side effects from increasing the linger time?

> -----Original Message-----
> From: William A. Rowe, Jr. [mailto:wrowe@rowe-clan.net]
> Sent: Monday, November 20, 2006 12:50 PM
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] Tuning the MaxKeepAliveRequests and
> KeepAliveTimeout http.conf parameters
> 
> Arthur Kreitman wrote:
> >
> > I noticed a random but all to frequent (perhaps 1 or 2 or 3 for
every
> > few hundred http requests) error from ap_core_output_filter (about
line
> > 903 in core_filters.c).   The error is an os 10054 "An existing
> > connection was forcibly closed by the remote host".   At the same
time,
> > the client side would believe the server performed a premature
socket
> > close.
> >
> > Regardless of the value of KeepAliveTimeout, if I set
> > MaxKeepAliveRequests to 1 (ie no keep alive) the error occurs for
almost
> > 80% or 90% of the http requests
> >
> > If I don't set MaxKeepAliveRequests, which then uses the default
value,
> > by setting KeepAliveTimeout between 60 and 90 seconds, the error
> disappears.
> 
> DING DING DING - thank you for providing the essentials for a
reproducible
> test case!!!
> 
> It sounds like we are not handling keep alive disconnection in the
best
> manner possible, leading to confusion by the ISAPI application.
> 
> > My understanding of KeepAliveTimeout is that it plays with the
socket
> > linger option.   What are the side effects of setting
KeepAliveTimeout
> > to a high value?   What are the side effects of setting
> > MaxKeepAliveRequests to a high value?
> 
> 1. fewer workers available to handle high load
> 
> 2. more exposure to denial of service (every daemon has an implicit
denial
>    of service that it can handle only X parallel requests over N
amount of
>    time - keeping N low helps mitigate this).
> 
> Contra wise, the benefit is that the next request from the same client
is
> handled more quickly, if you assume that 'next page' requests will
happen
> within the keepalivetimeout period.
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server
Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Tuning the MaxKeepAliveRequests and KeepAliveTimeout http.conf parameters

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Arthur Kreitman wrote:
> 
> I noticed a random but all to frequent (perhaps 1 or 2 or 3 for every
> few hundred http requests) error from ap_core_output_filter (about line
> 903 in core_filters.c).   The error is an os 10054 “An existing
> connection was forcibly closed by the remote host”.   At the same time,
> the client side would believe the server performed a premature socket
> close. 
> 
> Regardless of the value of KeepAliveTimeout, if I set
> MaxKeepAliveRequests to 1 (ie no keep alive) the error occurs for almost
> 80% or 90% of the http requests
> 
> If I don’t set MaxKeepAliveRequests, which then uses the default value,
> by setting KeepAliveTimeout between 60 and 90 seconds, the error disappears.

DING DING DING - thank you for providing the essentials for a reproducible
test case!!!

It sounds like we are not handling keep alive disconnection in the best
manner possible, leading to confusion by the ISAPI application.

> My understanding of KeepAliveTimeout is that it plays with the socket
> linger option.   What are the side effects of setting KeepAliveTimeout
> to a high value?   What are the side effects of setting
> MaxKeepAliveRequests to a high value?

1. fewer workers available to handle high load

2. more exposure to denial of service (every daemon has an implicit denial
   of service that it can handle only X parallel requests over N amount of
   time - keeping N low helps mitigate this).

Contra wise, the benefit is that the next request from the same client is
handled more quickly, if you assume that 'next page' requests will happen
within the keepalivetimeout period.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org