server seems busy

Alles, was den Apache betrifft, kann hier besprochen werden.

server seems busy

Postby hans.47836 » 04. March 2013 17:47

Hallo zusammen,

ich habe einen
Server version: Apache/2.2.22 (Unix)
Server built: Oct 25 2012 13:46:51

mit einigen Webseiten laufen, das Log wird überhäuft mit diesen Fehlern:

[Mon Mar 04 17:11:10 2013] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 18 idle, and 90 total children
[Mon Mar 04 17:14:10 2013] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 13 idle, and 96 total children
[Mon Mar 04 17:20:23 2013] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 15 idle, and 110 total children
[Mon Mar 04 17:21:31 2013] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 15 idle, and 110 total children
[Mon Mar 04 17:30:25 2013] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 6 idle, and 96 total children
[Mon Mar 04 17:30:26 2013] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 16 children, there are 19 idle, and 104 total children
[Mon Mar 04 17:35:50 2013] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 16 idle, and 84 total children
[Mon Mar 04 17:36:55 2013] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 15 idle, and 102 total children
[Mon Mar 04 17:36:56 2013] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 16 children, there are 18 idle, and 110 total children
[Mon Mar 04 17:42:11 2013] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 17 idle, and 112 total children
[Mon Mar 04 17:43:37 2013] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 14 idle, and 91 total children

Ich glaube prefork MPM zu haben, aber bin mir nicht sicher. Die Einstellungen sind:
# prefork MPM
StartServers 20
MinSpareServers 20
MaxSpareServers 50
ServerLimit 600
MaxClients 600
MaxRequestsPerChild 10000

# worker MPM
StartServers 3
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
MaxClients 150
ThreadsPerChild 25

Kann mir jemand sagen wie ich die Einstellungen anpassen muss?
hans.47836
 
Posts: 2
Joined: 04. March 2013 17:42
Operating System: Linux

Re: server seems busy

Postby Nobbie » 04. March 2013 21:45

hans.47836 wrote:Kann mir jemand sagen wie ich die Einstellungen anpassen muss?


Mit einem Editor.

Und was Du da tun musst, steht ja nun wirklich unübersehbar 20 mal untereinander:

(you may need to increase StartServers, or Min/MaxSpareServers)
(you may need to increase StartServers, or Min/MaxSpareServers)
(you may need to increase StartServers, or Min/MaxSpareServers)
(you may need to increase StartServers, or Min/MaxSpareServers)
(you may need to increase StartServers, or Min/MaxSpareServers)
(you may need to increase StartServers, or Min/MaxSpareServers)
(you may need to increase StartServers, or Min/MaxSpareServers)
(you may need to increase StartServers, or Min/MaxSpareServers)
(you may need to increase StartServers, or Min/MaxSpareServers)
(you may need to increase StartServers, or Min/MaxSpareServers)
(you may need to increase StartServers, or Min/MaxSpareServers)
(you may need to increase StartServers, or Min/MaxSpareServers)
(you may need to increase StartServers, or Min/MaxSpareServers)
(you may need to increase StartServers, or Min/MaxSpareServers)

...

Warum machst Du das nicht einfach?
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: server seems busy

Postby hans.47836 » 05. March 2013 09:26

Die Fehlermeldungen sind für mich unlogisch, der Server meldet ja das er ausgelastet ist.
Also, Server ausgelastet, d.h. nicht unbeschäftigt,
die MinSpareServer Einstellungen sind die Minimale Anzahl der unbeschäftigten Kindprozesse des Servers, fällt für mich weg,
ebenso die Maximale Anzahl der unbeschäftigten Kindprozesse des Servers.

Bleibt StartServers, aber dass der Server mit 20 Prozessen startet ist hierfür irrelevant, jetzt sind es halt mehr und er spawnt Prozesse wie ers braucht.
Also eigentlich würde ich davon ausgehen dass ein Limit, ServerLimit oder MaxClients erreicht ist.

Kann mir jemand erklärenwas genau in dem Moment vor sich geht? Ich würde schon gerne wissen wie das zusammenhängt.
hans.47836
 
Posts: 2
Joined: 04. March 2013 17:42
Operating System: Linux

Re: server seems busy

Postby Nobbie » 05. March 2013 11:41

hans.47836 wrote:jetzt sind es halt mehr und er spawnt Prozesse wie ers braucht.


Und genau deswegen wird der ErrorLog vollgeschrieben:

Aus http://httpd.apache.org/docs/2.2/de/mis ... uning.html

Process Creation

Prior to Apache 1.3 the MinSpareServers, MaxSpareServers, and StartServers settings all had drastic effects on benchmark results. In particular, Apache required a "ramp-up" period in order to reach a number of children sufficient to serve the load being applied. After the initial spawning of StartServers children, only one child per second would be created to satisfy the MinSpareServers setting. So a server being accessed by 100 simultaneous clients, using the default StartServers of 5 would take on the order 95 seconds to spawn enough children to handle the load. This works fine in practice on real-life servers, because they aren't restarted frequently. But does really poorly on benchmarks which might only run for ten minutes.

The one-per-second rule was implemented in an effort to avoid swamping the machine with the startup of new children. If the machine is busy spawning children it can't service requests. But it has such a drastic effect on the perceived performance of Apache that it had to be replaced. As of Apache 1.3, the code will relax the one-per-second rule. It will spawn one, wait a second, then spawn two, wait a second, then spawn four, and it will continue exponentially until it is spawning 32 children per second. It will stop whenever it satisfies the MinSpareServers setting.

This appears to be responsive enough that it's almost unnecessary to twiddle the MinSpareServers, MaxSpareServers and StartServers knobs. When more than 4 children are spawned per second, a message will be emitted to the ErrorLog. If you see a lot of these errors then consider tuning these settings. Use the mod_status output as a guide.

Related to process creation is process death induced by the MaxRequestsPerChild setting. By default this is 0, which means that there is no limit to the number of requests handled per child. If your configuration currently has this set to some very low number, such as 30, you may want to bump this up significantly. If you are running SunOS or an old version of Solaris, limit this to 10000 or so because of memory leaks.

When keep-alives are in use, children will be kept busy doing nothing waiting for more requests on the already open connection. The default KeepAliveTimeout of 5 seconds attempts to minimize this effect. The tradeoff here is between network bandwidth and server resources. In no event should you raise this above about 60 seconds, as most of the benefits are lost.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04


Return to Apache

Who is online

Users browsing this forum: No registered users and 17 guests