You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Tig <ti...@gmail.com> on 2005/03/03 14:00:58 UTC

[users@httpd] Slow response times under load, suggestions?

Hello. I'm not 100% sure I have the best config options for a server I
look after. The site is a very popular (non-commerical) site that
serves a lot of small files every day. The problem is, at certain
times throughout the day there are some traffic spikes and the server
goes into slow-motion for a while.

Here are a few 'top' read-outs (run in batch mode, so no CPU line):

last pid: 85976;  load averages: 177.71, 43.33, 28.51  up 31+14:57:29 
  07:50:07
1052 processes:2 running, 1050 sleeping
Mem: 632M Active, 80M Inact, 254M Wired, 34M Cache, 112M Buf, 1664K Free
Swap: 2048M Total, 717M Used, 1331M Free, 35% Inuse

last pid: 86023;  load averages: 208.72, 91.06, 49.44  up 31+15:02:40 
  07:55:18
1055 processes:3 running, 1052 sleeping
Mem: 635M Active, 78M Inact, 253M Wired, 22M Cache, 112M Buf, 13M Free
Swap: 2048M Total, 716M Used, 1332M Free, 34% Inuse

last pid: 86366;  load averages:  4.10, 26.05, 37.24  up 31+15:17:30    08:10:08
1057 processes:3 running, 1054 sleeping
Mem: 638M Active, 69M Inact, 256M Wired, 36M Cache, 112M Buf, 2468K Free
Swap: 2048M Total, 678M Used, 1370M Free, 33% Inuse

last pid: 86459;  load averages:  4.99, 13.67, 28.26  up 31+15:22:22    08:15:00
1060 processes:5 running, 1055 sleeping
Mem: 646M Active, 63M Inact, 257M Wired, 33M Cache, 112M Buf, 1688K Free
Swap: 2048M Total, 686M Used, 1362M Free, 33% Inuse

And here is some of the httpd.conf (that I think it is important)
<IfModule prefork.c>
StartServers    10
MinSpareServers 10
MaxSpareServers 30
ServerLimit             1024
MaxClients              1024
MaxRequestsPerChild  0
</IfModule>

The server is FreeBSD 4.11 and apache-2.0.53. This is why prefork is being used.

My understading (which may be wrong) is that the server is running out
of free processors, therefore queuing requests, which is why the
server is very slow to respond. Apache has 1024 allowed, and has
simply run out processors. The high CPU usage is a side-effect of
this.

My questions are, why are the sleepers not being dropped quicker, or
being re-used?

Should the MinSpareServer or MaxSpareServers (or both) be increased? 

Should the ServerLimit (and MaxClients) be increased, to handle the
load or decreased, as it appears a chunk of swap is being used?

Should the MaxRequestsPerChild be given a value, to help drop the
sleeping processors quicker?

Is it simply the hardware can not handle the load?

Thanks heaps for any advice!

---------------------------------------------------------------------
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] Slow response times under load, suggestions?

Posted by Joshua Slive <js...@gmail.com>.
On Fri, 4 Mar 2005 00:00:58 +1100, Tig <ti...@gmail.com> wrote:
> My understading (which may be wrong) is that the server is running out
> of free processors, therefore queuing requests, which is why the
> server is very slow to respond. Apache has 1024 allowed, and has
> simply run out processors. The high CPU usage is a side-effect of
> this.

I don't actually see evidence of high CPU usage.  I see a high load
average, but that is not the same thing.

> 
> My questions are, why are the sleepers not being dropped quicker, or
> being re-used?

Check mod_status's server-status page to see what the processes are
doing.  If you find that many are in KeepAlive state, then you can
probably increase throughput by reducing KeepAliveTimeout.

> Should the MinSpareServer or MaxSpareServers (or both) be increased?

No, these would likely have no effect (or even a harmeful effect).

> 
> Should the ServerLimit (and MaxClients) be increased, to handle the
> load or decreased, as it appears a chunk of swap is being used?

I'm not an expert on this stuff, but the swap usage suggests to me
that you are short of memory, in which case you will want to *reduce*
MaxClients to get the best performance.

> 
> Should the MaxRequestsPerChild be given a value, to help drop the
> sleeping processors quicker?

This will not help unless you have a memory leak.

> 
> Is it simply the hardware can not handle the load?

Possibly.

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