You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Richard Correia <ri...@ugamsolutions.com> on 2003/12/04 20:41:36 UTC

[users@httpd] Increasing MaxClients -- httpd.conf

Hi,

I am getting huge number of hits on my server, so I have increased the
MaxClients to 256. Now it seems like all my 256 clients are being used
and many requests are waiting in pool. Or at this point my apache is
denying further connections ?

How can I compile my apache to raise MaxClients limits ? My all
processes are in K mode [Keep-Alive ]. If I reduce the Keepalive time,
will that help me ? 

Because all this hits are coming to a single url, which just send a
cookie. Not much data. And I don't see multiple requests happening on
single socket.

Please let me know what I can do to overcome this. 

Thanks
Richard

Here is what my /server-status shows.

------------------------------------------------------------------------
--------
Server Version: Apache/1.3.23 (Unix) mod_jk/1.1.0 PHP/4.1.1
Server Built: Jul 4 2003 00:48:13
------------------------------------------------------------------------
--------

Current Time: Thursday, 04-Dec-2003 12:25:59 PST
Restart Time: Wednesday, 03-Dec-2003 13:10:34 PST

Parent Server Generation: 4 
Server uptime: 23 hours 15 minutes 25 seconds

Total accesses: 2196008 - Total Traffic: 406.0 MB    // So many hits in
24 hours

CPU Usage: u685.73 s636.61 cu529.11 cs34.61 - 2.25% CPU load

26.2 requests/sec - 5085 B/second - 193 B/request
256 requests currently being processed, 0 idle servers 

KKKKKKKKKKKKKKKKKKKKKKRKKKKKKKKKKRKKKKKKKKKKKKKKKKKKKKKKKKKRRKKK
KKKKKKKKKRKKKKKKKKKKRKKKRKKKKKKKKKWKKKRRWKKKKKKKKKRKKKKKKKKKKKRK
KKKRKKKKKKKKKKKKKWRRKKKRKKKKKKRKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
KKKKKKKKKKRKKKKKKKKKKKKKKKKKKKKKKKRWKKKKKKKKKKKKKKKKKKKKKKKKKKKK



---------------------------------------------------------------------
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] Increasing MaxClients -- httpd.conf

Posted by Richard Correia <ri...@ugamsolutions.com>.
Hi All,

It's great.

After some analysis, I simply turn off my keepalive.

Now It serves much faster.

Though CPU load is increased, my webserver is 80% faster now.

Thank you all.

Rich


-----Original Message-----
From: Joshua Slive [mailto:joshua@slive.ca] 
Sent: Friday, December 05, 2003 1:22 AM
To: users@httpd.apache.org; richard.correia@ugamsolutions.com
Cc: 'Robert Andersson'
Subject: Re: [users@httpd] Increasing MaxClients -- httpd.conf



On Fri, 5 Dec 2003, Richard Correia wrote:
> I am getting huge number of hits on my server, so I have increased the
> MaxClients to 256. Now it seems like all my 256 clients are being used
> and many requests are waiting in pool. Or at this point my apache is
> denying further connections ?

It queues up to ListenBacklog and then denies.

>
> How can I compile my apache to raise MaxClients limits ?

[assuming apache 1.3] add -D HARD_SERVER_LIMIT=1024 to your CFLAGS env
variable before compiling, or edit src/include/httpd.h and change the
HARD_SERVER_LIMIT define.

> My all
> processes are in K mode [Keep-Alive ]. If I reduce the Keepalive time,
> will that help me ?

Yes.

> Because all this hits are coming to a single url, which just send a
> cookie. Not much data. And I don't see multiple requests happening on
> single socket.

If each client is sending only a single request to your server, then
keep-alives do you no good at all.  Turn them off and you'll be able to
handle lots more hits.

Joshua.

---------------------------------------------------------------------
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] Increasing MaxClients -- httpd.conf

Posted by Joshua Slive <jo...@slive.ca>.
On Fri, 5 Dec 2003, Richard Correia wrote:
> I am getting huge number of hits on my server, so I have increased the
> MaxClients to 256. Now it seems like all my 256 clients are being used
> and many requests are waiting in pool. Or at this point my apache is
> denying further connections ?

It queues up to ListenBacklog and then denies.

>
> How can I compile my apache to raise MaxClients limits ?

[assuming apache 1.3] add -D HARD_SERVER_LIMIT=1024 to your CFLAGS env
variable before compiling, or edit src/include/httpd.h and change the
HARD_SERVER_LIMIT define.

> My all
> processes are in K mode [Keep-Alive ]. If I reduce the Keepalive time,
> will that help me ?

Yes.

> Because all this hits are coming to a single url, which just send a
> cookie. Not much data. And I don't see multiple requests happening on
> single socket.

If each client is sending only a single request to your server, then
keep-alives do you no good at all.  Turn them off and you'll be able to
handle lots more hits.

Joshua.

---------------------------------------------------------------------
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] Increasing MaxClients -- httpd.conf

Posted by "Richard F. Rebel" <rr...@whenu.com>.
Hi,

If you are not expecting multiple requests over the same socket, you can
disable KeepAlives with:

KeepAlive Off

If you wish to continue supporting KeepAlive, then you can lower the
KeepAliveTimeout with:

KeepAliveTimeout 5

You should include the version of apache and the OS when making requests
to the list.  Apache 2.x supports a threaded MPM called 'worker' that
works well for high volumes of simul connections.

FYI if you are using Apache 1.x there is a compile time option limiting
the max number for MaxClients.  I think it's set to 256 or 500 or
something small, so if you have the memory, increase this setting and
recompile (it's in httpd.h).  There is documentation on the apache site
for this.  Don't forget to increase your available file descriptors as
well.

Best,

Richard F. Rebel

On Thu, 2003-12-04 at 14:41, Richard Correia wrote:
> Hi,
> 
> I am getting huge number of hits on my server, so I have increased the
> MaxClients to 256. Now it seems like all my 256 clients are being used
> and many requests are waiting in pool. Or at this point my apache is
> denying further connections ?
> 
> How can I compile my apache to raise MaxClients limits ? My all
> processes are in K mode [Keep-Alive ]. If I reduce the Keepalive time,
> will that help me ? 
> 
> Because all this hits are coming to a single url, which just send a
> cookie. Not much data. And I don't see multiple requests happening on
> single socket.
> 
> Please let me know what I can do to overcome this. 
> 
> Thanks
> Richard
> 
> Here is what my /server-status shows.
> 
> ------------------------------------------------------------------------
> --------
> Server Version: Apache/1.3.23 (Unix) mod_jk/1.1.0 PHP/4.1.1
> Server Built: Jul 4 2003 00:48:13
> ------------------------------------------------------------------------
> --------
> 
> Current Time: Thursday, 04-Dec-2003 12:25:59 PST
> Restart Time: Wednesday, 03-Dec-2003 13:10:34 PST
> 
> Parent Server Generation: 4 
> Server uptime: 23 hours 15 minutes 25 seconds
> 
> Total accesses: 2196008 - Total Traffic: 406.0 MB    // So many hits in
> 24 hours
> 
> CPU Usage: u685.73 s636.61 cu529.11 cs34.61 - 2.25% CPU load
> 
> 26.2 requests/sec - 5085 B/second - 193 B/request
> 256 requests currently being processed, 0 idle servers 
> 
> KKKKKKKKKKKKKKKKKKKKKKRKKKKKKKKKKRKKKKKKKKKKKKKKKKKKKKKKKKKRRKKK
> KKKKKKKKKRKKKKKKKKKKRKKKRKKKKKKKKKWKKKRRWKKKKKKKKKRKKKKKKKKKKKRK
> KKKRKKKKKKKKKKKKKWRRKKKRKKKKKKRKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
> KKKKKKKKKKRKKKKKKKKKKKKKKKKKKKKKKKRWKKKKKKKKKKKKKKKKKKKKKKKKKKKK
> 
> 
> 
> ---------------------------------------------------------------------
> 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
-- 
Richard F. Rebel
rrebel@whenu.com
t. 212.239.0000