reached MaxClients / Absturz und keine Speicherfreigabe mehr

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

reached MaxClients / Absturz und keine Speicherfreigabe mehr

Postby forced » 03. March 2010 19:54

Hallo,

ich besitze einen Root-Server bei Hetzner welcher rund um die Uhr mit vielen HTTP-Anfragen belastet wird.

Eckdaten: Intel® Core™ i7-920 Quad-Core mit 8 GB Ram @ Ubuntu 9.04 64 Bit.

Als Webserver fungiert der Apache- Seit ca. 3 Wochen haben sich die Anfragen verdoppelt und seit dem stürzt der Apache ca alle 24 Stunden 1x ab.

error.log:
[Wed Mar 03 13:20:49 2010] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 0 idle, and 118 total children
[Wed Mar 03 13:20:50 2010] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 16 children, there are 0 idle, and 126 total children
[Wed Mar 03 13:20:51 2010] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 32 children, there are 0 idle, and 142 total children
[Wed Mar 03 13:20:52 2010] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 32 children, there are 0 idle, and 174 total children
[Wed Mar 03 13:20:54 2010] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 32 children, there are 0 idle, and 206 total children
[Wed Mar 03 13:20:55 2010] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 32 children, there are 0 idle, and 238 total children
[Wed Mar 03 13:20:57 2010] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 32 children, there are 0 idle, and 270 total children
[Wed Mar 03 13:20:58 2010] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 32 children, there are 0 idle, and 302 total children
[Wed Mar 03 13:21:00 2010] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 32 children, there are 0 idle, and 334 total children
[Wed Mar 03 13:21:02 2010] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 32 children, there are 0 idle, and 366 total children
[Wed Mar 03 13:21:03 2010] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 32 children, there are 2 idle, and 398 total children
[Wed Mar 03 13:21:04 2010] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 32 children, there are 5 idle, and 430 total children
[Wed Mar 03 13:21:05 2010] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 32 children, there are 13 idle, and 462 total children
[Wed Mar 03 13:21:07 2010] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 32 children, there are 19 idle, and 494 total children
[Wed Mar 03 13:21:08 2010] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 32 children, there are 18 idle, and 526 total children
[Wed Mar 03 13:21:09 2010] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 32 children, there are 37 idle, and 558 total children
[Wed Mar 03 13:21:10 2010] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 32 children, there are 49 idle, and 590 total children
[Wed Mar 03 13:21:13 2010] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 32 children, there are 26 idle, and 622 total children
[Wed Mar 03 13:21:14 2010] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 32 children, there are 37 idle, and 654 total children
[Wed Mar 03 13:21:15 2010] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 32 children, there are 52 idle, and 686 total children
[Wed Mar 03 13:21:16 2010] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 32 children, there are 59 idle, and 718 total children
[Wed Mar 03 13:21:19 2010] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 32 children, there are 27 idle, and 750 total children
[Wed Mar 03 13:21:20 2010] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 32 children, there are 46 idle, and 782 total children
[Wed Mar 03 13:21:21 2010] [error] server reached MaxClients setting, consider raising the MaxClients setting
[Wed Mar 03 13:27:38 2010] [warn] child process 28948 still did not exit, sending a SIGTERM
[Wed Mar 03 13:27:40 2010] [warn] child process 28948 still did not exit, sending a SIGTERM
[Wed Mar 03 13:27:43 2010] [warn] child process 28948 still did not exit, sending a SIGTERM
[Wed Mar 03 13:27:45 2010] [error] child process 28948 still did not exit, sending a SIGKILL


Was mir auch aufgefallen ist, der Server verabschiedet sich hin und wieder auch Nachts, also zu untypischen Zeiten wenn gar nicht so viele Anfragen vorhanden sind. Der Speicher läuft einfach voll nach einer Zeit.

Seit geraumer Zeit teste ich daher verschiedene Servereinstellungen:
KeepAlive Off
KeepAliveTimeout 2

<IfModule mpm_prefork_module>
StartServers 200
MinSpareServers 70
MaxSpareServers 100
ServerLimit 1000
MaxClients 800
MaxRequestsPerChild 5000
</IfModule>


MaxClients noch höher eintzstellen halte ich für weniger Sinnvoll, da der Fehler auch bei 400 oder 600 Clients erscheint.. Habe das gefühl, dass ich woanders einen Schalter umlegen muss.
Stelle ich KeepAlive an, so stürzt er noch schneller ab.

Stürzt der Apache ab, so habe ich nen Serverload von ~500 und hunderte Prozesse in der Prozessliste. Um den Apache wiederzubeleben führe ich einen restart durch. Dann habe ich wieder knapp ~16-24 Stunden Zeit bis zum nächsten Absturz.

Zudem habe ich einen permanenten Zombiprozess vom apache in der Prozessliste und der Speicher wird vom Apache nicht mehr freigegeben wenn ich ihn stoppe... Nur ein richtiger Server-neustart gibt den Arbeitsspeicher wieder frei.

Ich hoffe nun, dass einer von Euch Ratschläge bzgl. meiner Konfig. hat. Ansonsten bleibt mir wohl nur der Umstieg auf den Apache-Worker, wobei ich dies wenn möglich verhindern möchte, da ich Angst vor der Umstellung habe (vhosts, PHP-Version wird ebenfalls dadurch geupdated, eAccelerator funktioniert nicht mehr etc.)

Vielen Dank!
forced
 
Posts: 1
Joined: 03. March 2010 19:52

Return to Apache

Who is online

Users browsing this forum: No registered users and 3 guests