You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Petr Hracek <ph...@gmail.com> on 2011/10/18 09:06:18 UTC

[users@httpd] apache seems to be busy

Dear users,

sporadically on the machines whereis installed apache2-2.2.21
in the log /var/log/apache2/error_log I have observed following:

[Tue Oct 18 07:01:54 2011] [info] server seems busy, (you may need to
increase StartServers, or Min/MaxSpareServers), spawning 8 children,
there are 0 idle, and 17 total children
[Tue Oct 18 07:01:55 2011] [info] server seems busy, (you may need to
increase StartServers, or Min/MaxSpareServers), spawning 16 children,
there are 0 idle, and 25 total children

Is there any way how to track whether sessions are closed correctly,
what childrens are still up,

My setting of the server is:
Timeout 300
KeepAlive On
KeepAliveTimeout 5
MaxKeepAliveRequests 100
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 10000

What shall I changed?

-- 
Best Regards / S pozdravem
Petr Hracek

---------------------------------------------------------------------
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] apache seems to be busy

Posted by Giles Coochey <gi...@coochey.net>.
On Tue, October 18, 2011 13:11, Petr Hracek wrote:
> Dear users,
>
> There are run most AJAX requests. After increasing the values
> StartServers 15
> MinSpareServers 10
> MaxSpareServers 30
>

I guess it is possible, do you eventually hit MaxClients (150 total
children)?

> ==> error_log <==
> [Tue Oct 18 11:25:59 2011] [info] server seems busy, (you may need to
> increase StartServers, or Min/MaxSpareServers), spawning 8 children,
> there are 0 idle, and 23 total children
> [Tue Oct 18 11:26:00 2011] [info] server seems busy, (you may need to
> increase StartServers, or Min/MaxSpareServers), spawning 16 children,
> there are 7 idle, and 31 total children
>
> Can there be a problem that AJAX objects did not close the connections
> properly?
>
> Thank you in advance
>
> Dne 18. října 2011 10:36 Giles Coochey <gi...@coochey.net> napsal(a):
>> On Tue, October 18, 2011 09:06, Petr Hracek wrote:
>>> Dear users,
>>>
>>> sporadically on the machines whereis installed apache2-2.2.21
>>> in the log /var/log/apache2/error_log I have observed following:
>>>
>>> [Tue Oct 18 07:01:54 2011] [info] server seems busy, (you may need to
>>> increase StartServers, or Min/MaxSpareServers), spawning 8 children,
>>> there are 0 idle, and 17 total children
>>> [Tue Oct 18 07:01:55 2011] [info] server seems busy, (you may need to
>>> increase StartServers, or Min/MaxSpareServers), spawning 16 children,
>>> there are 0 idle, and 25 total children
>>>
>>> Is there any way how to track whether sessions are closed correctly,
>>> what childrens are still up,
>>>
>>> My setting of the server is:
>>> Timeout 300
>>> KeepAlive On
>>> KeepAliveTimeout 5
>>> MaxKeepAliveRequests 100
>>> StartServers 5
>>
>> Assuming you have the spare resources:
>>
>> I would try StartServers being raised to 15 and see if you still get the
>> message.
>>
>>> MinSpareServers 5
>>
>> Increase MinSpareServers to 10
>>
>>> MaxSpareServers 10
>>
>> Increase maxSpareServers to 30
>>
>>> MaxClients 150
>>> MaxRequestsPerChild 10000
>>>
>>> What shall I changed?
>>>
>>> --
>>> Best Regards / S pozdravem
>>> Petr Hracek
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>>
>
>
>
> --
> Best Regards / S pozdravem
> Petr Hracek
>
> ---------------------------------------------------------------------
> 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] apache seems to be busy

Posted by Giles Coochey <gi...@coochey.net>.
On 18/10/2011 12:59, Tom Evans wrote:
> On Tue, Oct 18, 2011 at 12:11 PM, Petr Hracek<ph...@gmail.com>  wrote:
>> Dear users,
>>
>> There are run most AJAX requests. After increasing the values
>> StartServers 15
>> MinSpareServers 10
>> MaxSpareServers 30
>>
>> ==>  error_log<==
>> [Tue Oct 18 11:25:59 2011] [info] server seems busy, (you may need to
>> increase StartServers, or Min/MaxSpareServers), spawning 8 children,
>> there are 0 idle, and 23 total children
>> [Tue Oct 18 11:26:00 2011] [info] server seems busy, (you may need to
>> increase StartServers, or Min/MaxSpareServers), spawning 16 children,
>> there are 7 idle, and 31 total children
>>
>> Can there be a problem that AJAX objects did not close the connections properly?
>>
>> Thank you in advance
>>
> Anything is possible, but no, that is unlikely.
>
> Do you have more of these messages in the log? It looks like you don't
> start enough children to serve your peak load. These two log entries
> show that your server started with 15, and within a few seconds
> started an additional 16 children, indicating that you need to
> increase your StartServers.
>
> Forking isn't free, so you will want to start as many child processes
> as you will probably need, and allow them to stay alive rather than
> killing them off when you get quiet, just to respawn them again when
> you are busy. The trade-off from doing this is that each child
> consumes memory.
>
> Therefore:
>
> Set StartServers and MaxSpareServers to the same value, and increase
> both until you don't get these messages - we increase MaxSpareServers
> so that it doesn't just kill them all off in quiet periods.
>
> Once you have found how many server children you need, set
> StartServers to that value, MaxSpareServers to maybe 80% of that
> value, and MinSpareServers to about 10% of that value.
>
> The next step is working out how many server children is too many. To
> do this, you need to stress test your application, trying to get it
> super busy - basically, in fact, until Apache croaks that you need to
> increase MaxClients.
>
> Stop the test, increase MaxClients (if you increase it above 256, you
> also need to increase ServerLimit), repeat test. Do this until your
> server runs out of memory/CPU/disk - that is your absolute limit to
> number of server children. I'd normally step back a bit from that, to
> allow some overhead.
>
> As an example, one of our busy apache servers has StartServers 200,
> MinSpareServer 20, MaxSpareServers 160, MaxClients 512, ServerLimit
> 512. When we approach MaxClients, the box is approaching running out
> of memory.
>
>
Good advice.

You might want to bear in mind what else your server is doing other than 
running Apache and what your available resources (memory / CPU) are. If 
you are running maintenance jobs during low-usage periods and have 
limited resources, such as with many Vms, then you might want to trade 
off some of the 'StartServers' for the extra resources on your system at 
low usage periods.
The best action depends on your particular environment you should check 
the docs and come to a reasoned configuration based on what you've seen 
in your logs.



Re: [users@httpd] apache seems to be busy

Posted by Tom Evans <te...@googlemail.com>.
On Wed, Oct 19, 2011 at 7:52 AM, Petr Hracek <ph...@gmail.com> wrote:
> Hello Tom,
>
> as you mentioned I need to do stress test of the application.
> How to do that for SSL connection?
>
> best regards
> Petr
>

ab, siege, flood, jmeter, grinder, httperf, OpenSTA, curl-loader,
Spirent Avalanche (not free)…

Cheers

Tom

---------------------------------------------------------------------
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] apache seems to be busy

Posted by Petr Hracek <ph...@gmail.com>.
Hello Tom,

as you mentioned I need to do stress test of the application.
How to do that for SSL connection?

best regards
Petr

Dne 18. října 2011 13:59 Tom Evans <te...@googlemail.com> napsal(a):
> On Tue, Oct 18, 2011 at 12:11 PM, Petr Hracek <ph...@gmail.com> wrote:
>> Dear users,
>>
>> There are run most AJAX requests. After increasing the values
>> StartServers 15
>> MinSpareServers 10
>> MaxSpareServers 30
>>
>> ==> error_log <==
>> [Tue Oct 18 11:25:59 2011] [info] server seems busy, (you may need to
>> increase StartServers, or Min/MaxSpareServers), spawning 8 children,
>> there are 0 idle, and 23 total children
>> [Tue Oct 18 11:26:00 2011] [info] server seems busy, (you may need to
>> increase StartServers, or Min/MaxSpareServers), spawning 16 children,
>> there are 7 idle, and 31 total children
>>
>> Can there be a problem that AJAX objects did not close the connections properly?
>>
>> Thank you in advance
>>
>
> Anything is possible, but no, that is unlikely.
>
> Do you have more of these messages in the log? It looks like you don't
> start enough children to serve your peak load. These two log entries
> show that your server started with 15, and within a few seconds
> started an additional 16 children, indicating that you need to
> increase your StartServers.
>
> Forking isn't free, so you will want to start as many child processes
> as you will probably need, and allow them to stay alive rather than
> killing them off when you get quiet, just to respawn them again when
> you are busy. The trade-off from doing this is that each child
> consumes memory.
>
> Therefore:
>
> Set StartServers and MaxSpareServers to the same value, and increase
> both until you don't get these messages - we increase MaxSpareServers
> so that it doesn't just kill them all off in quiet periods.
>
> Once you have found how many server children you need, set
> StartServers to that value, MaxSpareServers to maybe 80% of that
> value, and MinSpareServers to about 10% of that value.
>
> The next step is working out how many server children is too many. To
> do this, you need to stress test your application, trying to get it
> super busy - basically, in fact, until Apache croaks that you need to
> increase MaxClients.
>
> Stop the test, increase MaxClients (if you increase it above 256, you
> also need to increase ServerLimit), repeat test. Do this until your
> server runs out of memory/CPU/disk - that is your absolute limit to
> number of server children. I'd normally step back a bit from that, to
> allow some overhead.
>
> As an example, one of our busy apache servers has StartServers 200,
> MinSpareServer 20, MaxSpareServers 160, MaxClients 512, ServerLimit
> 512. When we approach MaxClients, the box is approaching running out
> of memory.
>
> Hope that helps
>
> Cheers
>
> Tom
>
> ---------------------------------------------------------------------
> 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
>
>



-- 
Best Regards / S pozdravem
Petr Hracek

---------------------------------------------------------------------
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] apache seems to be busy

Posted by Tom Evans <te...@googlemail.com>.
On Tue, Oct 18, 2011 at 12:11 PM, Petr Hracek <ph...@gmail.com> wrote:
> Dear users,
>
> There are run most AJAX requests. After increasing the values
> StartServers 15
> MinSpareServers 10
> MaxSpareServers 30
>
> ==> error_log <==
> [Tue Oct 18 11:25:59 2011] [info] server seems busy, (you may need to
> increase StartServers, or Min/MaxSpareServers), spawning 8 children,
> there are 0 idle, and 23 total children
> [Tue Oct 18 11:26:00 2011] [info] server seems busy, (you may need to
> increase StartServers, or Min/MaxSpareServers), spawning 16 children,
> there are 7 idle, and 31 total children
>
> Can there be a problem that AJAX objects did not close the connections properly?
>
> Thank you in advance
>

Anything is possible, but no, that is unlikely.

Do you have more of these messages in the log? It looks like you don't
start enough children to serve your peak load. These two log entries
show that your server started with 15, and within a few seconds
started an additional 16 children, indicating that you need to
increase your StartServers.

Forking isn't free, so you will want to start as many child processes
as you will probably need, and allow them to stay alive rather than
killing them off when you get quiet, just to respawn them again when
you are busy. The trade-off from doing this is that each child
consumes memory.

Therefore:

Set StartServers and MaxSpareServers to the same value, and increase
both until you don't get these messages - we increase MaxSpareServers
so that it doesn't just kill them all off in quiet periods.

Once you have found how many server children you need, set
StartServers to that value, MaxSpareServers to maybe 80% of that
value, and MinSpareServers to about 10% of that value.

The next step is working out how many server children is too many. To
do this, you need to stress test your application, trying to get it
super busy - basically, in fact, until Apache croaks that you need to
increase MaxClients.

Stop the test, increase MaxClients (if you increase it above 256, you
also need to increase ServerLimit), repeat test. Do this until your
server runs out of memory/CPU/disk - that is your absolute limit to
number of server children. I'd normally step back a bit from that, to
allow some overhead.

As an example, one of our busy apache servers has StartServers 200,
MinSpareServer 20, MaxSpareServers 160, MaxClients 512, ServerLimit
512. When we approach MaxClients, the box is approaching running out
of memory.

Hope that helps

Cheers

Tom

---------------------------------------------------------------------
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] apache seems to be busy

Posted by Petr Hracek <ph...@gmail.com>.
Dear users,

There are run most AJAX requests. After increasing the values
StartServers 15
MinSpareServers 10
MaxSpareServers 30

==> error_log <==
[Tue Oct 18 11:25:59 2011] [info] server seems busy, (you may need to
increase StartServers, or Min/MaxSpareServers), spawning 8 children,
there are 0 idle, and 23 total children
[Tue Oct 18 11:26:00 2011] [info] server seems busy, (you may need to
increase StartServers, or Min/MaxSpareServers), spawning 16 children,
there are 7 idle, and 31 total children

Can there be a problem that AJAX objects did not close the connections properly?

Thank you in advance

Dne 18. října 2011 10:36 Giles Coochey <gi...@coochey.net> napsal(a):
> On Tue, October 18, 2011 09:06, Petr Hracek wrote:
>> Dear users,
>>
>> sporadically on the machines whereis installed apache2-2.2.21
>> in the log /var/log/apache2/error_log I have observed following:
>>
>> [Tue Oct 18 07:01:54 2011] [info] server seems busy, (you may need to
>> increase StartServers, or Min/MaxSpareServers), spawning 8 children,
>> there are 0 idle, and 17 total children
>> [Tue Oct 18 07:01:55 2011] [info] server seems busy, (you may need to
>> increase StartServers, or Min/MaxSpareServers), spawning 16 children,
>> there are 0 idle, and 25 total children
>>
>> Is there any way how to track whether sessions are closed correctly,
>> what childrens are still up,
>>
>> My setting of the server is:
>> Timeout 300
>> KeepAlive On
>> KeepAliveTimeout 5
>> MaxKeepAliveRequests 100
>> StartServers 5
>
> Assuming you have the spare resources:
>
> I would try StartServers being raised to 15 and see if you still get the
> message.
>
>> MinSpareServers 5
>
> Increase MinSpareServers to 10
>
>> MaxSpareServers 10
>
> Increase maxSpareServers to 30
>
>> MaxClients 150
>> MaxRequestsPerChild 10000
>>
>> What shall I changed?
>>
>> --
>> Best Regards / S pozdravem
>> Petr Hracek
>>
>> ---------------------------------------------------------------------
>> 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
>
>



-- 
Best Regards / S pozdravem
Petr Hracek

---------------------------------------------------------------------
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] apache seems to be busy

Posted by Giles Coochey <gi...@coochey.net>.
On Tue, October 18, 2011 09:06, Petr Hracek wrote:
> Dear users,
>
> sporadically on the machines whereis installed apache2-2.2.21
> in the log /var/log/apache2/error_log I have observed following:
>
> [Tue Oct 18 07:01:54 2011] [info] server seems busy, (you may need to
> increase StartServers, or Min/MaxSpareServers), spawning 8 children,
> there are 0 idle, and 17 total children
> [Tue Oct 18 07:01:55 2011] [info] server seems busy, (you may need to
> increase StartServers, or Min/MaxSpareServers), spawning 16 children,
> there are 0 idle, and 25 total children
>
> Is there any way how to track whether sessions are closed correctly,
> what childrens are still up,
>
> My setting of the server is:
> Timeout 300
> KeepAlive On
> KeepAliveTimeout 5
> MaxKeepAliveRequests 100
> StartServers 5

Assuming you have the spare resources:

I would try StartServers being raised to 15 and see if you still get the
message.

> MinSpareServers 5

Increase MinSpareServers to 10

> MaxSpareServers 10

Increase maxSpareServers to 30

> MaxClients 150
> MaxRequestsPerChild 10000
>
> What shall I changed?
>
> --
> Best Regards / S pozdravem
> Petr Hracek
>
> ---------------------------------------------------------------------
> 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