PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Apache Speicherproblem & Systemabsturz



Zoba
11.10.10, 05:41
Hallo,

ich habe da ein Problem, bei dem ich nicht mehr weiter weiß. Kurz zur Ausgangslage: Ich arbeite an einem Open Data Projekt mit (Openstreetmap). Für bestimmte Aufgaben dort brauche ich einen Server. Ich persönlich komme mit Linux nur etwas zu recht, also einfache Wartung, Installation,etc. Es gibt nur dummerweise keine echte Alternative zum eigenen Server.
Auf meinem Server läuft hauptsächlich Apache in Verbindung mit Mapserver (http://mapserver.org/).
Der Editor JOSM, mit dem bei Openstreetmap hauptsächlich gearbeitet wird, übergibt dabei per Link Parameter an meinen Server. Die Paramter werden durch eine Datei wms.wsgi (http://trac.openstreetmap.org/browser/sites/wms.openstreetmap.de/wms.wsgi) ausgewertet und ein Bild wird zurückgeliefert. Teilweise wird es erst mit einem Python Skript erstellt. Die Zugriffe erfolgen dann so...zwischen 1s und 1Minute, jeweils so 6 -9 Links, die gleichzeitig übergeben werden. Da ich den Server nur für 3 Leute bereitsstelle, die auch nie zeitgleich arbeiten, sollte die Last eigentlich gering sein. Die CPU langweilt sich auch ziemlich und ist sehr selten mit mehr als 10% ausgelastet.
So. Nun ist mir der Rechner jetzt schon öfter komplett oder teilweise abgestürzt. Je länger man arbeitet, desto mehr Speicher braucht jeder Apache-Prozess. Pausiert man, gibt Apache den Speicher aber oft nicht wieder frei. Es scheint mir fast so, als wenn Apache das ganze Zeugs cached. Das wäre aber gar nicht nötig, weil die Clients cachen.
Anbei eine Munin Grafik. Ich hatte den Abend etwas gemacht und Apache die Nacht über vom Internet getrennt. Apache hat also die ganze Nacht über nichts zu tun gehabt
http://img841.imageshack.us/img841/5140/apachespeicher.jpg (http://img841.imageshack.us/i/apachespeicher.jpg/)

Nach einer Weile haben die Apache-Prozesse den kompletten Speicher (1GB RAM + 3GB Swap) in Beschlag genommen. Dann ist wirklich 0B frei. Der OOM Killer schlägt dann zu, aber das interessiert die Apache-Prozesse überhaupt nicht. Die laufen einfach weiter.
Machmal schaffe ich es, den Rechner neu zu starten. Manchmal geht es nur mit der ganz harten Methode.
Kann mir jemand helfen das Problem zu lösen oder einzugrenzen? Fehlermeldungen in verschiedenen Logs habe ich, aber ich weiß nicht genau, welche euch jetzt interessieren.

Vielen Dank
Thomas

marce
11.10.10, 06:12
Logs und Config, Ausgaben von top / free posten.

Zoba
11.10.10, 08:51
Hallo,

anbei erstmal die Logs während eines Crashs

/var/log/messages


Oct 4 22:23:56 SunCobalt hal-ipw-killswitch-linux: error: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote a
pplication did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
Oct 4 22:24:20 SunCobalt kernel: [226330.750743] NetworkManager invoked oom-killer: gfp_mask=0x1201d2, order=0, oomkilladj=0
Oct 4 22:24:20 SunCobalt kernel: [226330.750749] Pid: 3992, comm: NetworkManager Not tainted 2.6.26-2-amd64 #1
Oct 4 22:24:20 SunCobalt kernel: [226330.750752]
Oct 4 22:24:20 SunCobalt kernel: [226330.750752] Call Trace:
Oct 4 22:24:20 SunCobalt kernel: [226330.750777] [<ffffffff8027388c>] oom_kill_process+0x57/0x1dc
Oct 4 22:24:20 SunCobalt kernel: [226330.750783] [<ffffffff8023b49d>] __capable+0x9/0x1c
Oct 4 22:24:20 SunCobalt kernel: [226330.750786] [<ffffffff80273bb7>] badness+0x188/0x1c7
Oct 4 22:24:20 SunCobalt kernel: [226330.750790] [<ffffffff80273deb>] out_of_memory+0x1f5/0x28e
Oct 4 22:24:20 SunCobalt kernel: [226330.750798] [<ffffffff80276b3c>] __alloc_pages_internal+0x31d/0x3bf
Oct 4 22:24:20 SunCobalt kernel: [226330.750806] [<ffffffff802787f2>] __do_page_cache_readahead+0x79/0x183
Oct 4 22:24:20 SunCobalt kernel: [226330.750813] [<ffffffff802730a1>] filemap_fault+0x15d/0x33c
Oct 4 22:24:20 SunCobalt kernel: [226330.750820] [<ffffffff8027e620>] __do_fault+0x50/0x3e6
Oct 4 22:24:20 SunCobalt kernel: [226330.750823] [<ffffffff8020bf89>] sysret_signal+0x2b/0x45
Oct 4 22:24:20 SunCobalt kernel: [226330.750832] [<ffffffff80281983>] handle_mm_fault+0x3f4/0x867
Oct 4 22:24:20 SunCobalt kernel: [226330.750839] [<ffffffff8029b4f2>] do_readv_writev+0x176/0x18b
Oct 4 22:24:20 SunCobalt kernel: [226330.750846] [<ffffffff80221fbc>] do_page_fault+0x5d8/0x9c8
Oct 4 22:24:20 SunCobalt kernel: [226330.750854] [<ffffffff8042a869>] error_exit+0x0/0x60
Oct 4 22:24:20 SunCobalt kernel: [226330.750863]
Oct 4 22:24:20 SunCobalt kernel: [226330.750865] Mem-info:
Oct 4 22:24:20 SunCobalt kernel: [226330.750866] Node 0 DMA per-cpu:
Oct 4 22:24:20 SunCobalt kernel: [226330.750869] CPU 0: hi: 0, btch: 1 usd: 0
Oct 4 22:24:20 SunCobalt kernel: [226330.750872] CPU 1: hi: 0, btch: 1 usd: 0
Oct 4 22:24:20 SunCobalt kernel: [226330.750873] Node 0 DMA32 per-cpu:
Oct 4 22:24:20 SunCobalt kernel: [226330.750876] CPU 0: hi: 186, btch: 31 usd: 185
Oct 4 22:24:20 SunCobalt kernel: [226330.750878] CPU 1: hi: 186, btch: 31 usd: 175
Oct 4 22:24:20 SunCobalt kernel: [226330.750882] Active:119564 inactive:120492 dirty:0 writeback:0 unstable:0
Oct 4 22:24:20 SunCobalt kernel: [226330.750884] free:1985 slab:4918 mapped:98 pagetables:4733 bounce:0
Oct 4 22:24:20 SunCobalt kernel: [226330.750886] Node 0 DMA free:3996kB min:40kB low:48kB high:60kB active:4184kB inactive:3096kB present:10792kB pages_scan
ned:11686 all_unreclaimable? yes
Oct 4 22:24:20 SunCobalt kernel: [226330.750891] lowmem_reserve[]: 0 992 992 992
Oct 4 22:24:20 SunCobalt kernel: [226330.750895] Node 0 DMA32 free:3944kB min:4008kB low:5008kB high:6012kB active:473972kB inactive:478872kB present:101662
8kB pages_scanned:1754762 all_unreclaimable? yes
Oct 4 22:24:20 SunCobalt kernel: [226330.750901] lowmem_reserve[]: 0 0 0 0
Oct 4 22:24:20 SunCobalt kernel: [226330.750904] Node 0 DMA: 5*4kB 1*8kB 0*16kB 0*32kB 0*64kB 1*128kB 1*256kB 1*512kB 1*1024kB 1*2048kB 0*4096kB = 3996kB
Oct 4 22:24:20 SunCobalt kernel: [226330.750914] Node 0 DMA32: 42*4kB 2*8kB 1*16kB 1*32kB 0*64kB 1*128kB 0*256kB 1*512kB 1*1024kB 1*2048kB 0*4096kB = 3944kB
Oct 4 22:24:20 SunCobalt kernel: [226330.750924] 147 total pagecache pages
Oct 4 22:24:20 SunCobalt kernel: [226330.750926] Swap cache: add 2506244, delete 2506232, find 22040720/22165631
Oct 4 22:24:20 SunCobalt kernel: [226330.750929] Free swap = 0kB
Oct 4 22:24:20 SunCobalt kernel: [226330.750930] Total swap = 3004112kB
Oct 4 22:24:20 SunCobalt kernel: [226330.756728] 261776 pages of RAM
Oct 4 22:24:20 SunCobalt kernel: [226330.756730] 4787 reserved pages
Oct 4 22:24:20 SunCobalt kernel: [226330.756732] 3123 pages shared
Oct 4 22:24:20 SunCobalt kernel: [226330.756734] 12 pages swap cached
Oct 4 22:25:19 SunCobalt kernel: [226379.087521] udevd invoked oom-killer: gfp_mask=0x1201d2, order=0, oomkilladj=-17
Oct 4 22:25:19 SunCobalt kernel: [226379.087526] Pid: 15487, comm: udevd Not tainted 2.6.26-2-amd64 #1
Oct 4 22:25:19 SunCobalt kernel: [226379.087529]
Oct 4 22:25:19 SunCobalt kernel: [226379.087530] Call Trace:
Oct 4 22:25:19 SunCobalt kernel: [226379.087555] [<ffffffff8027388c>] oom_kill_process+0x57/0x1dc
Oct 4 22:25:19 SunCobalt kernel: [226379.087560] [<ffffffff8023b49d>] __capable+0x9/0x1c
Oct 4 22:25:19 SunCobalt kernel: [226379.087563] [<ffffffff80273bb7>] badness+0x188/0x1c7
Oct 4 22:25:19 SunCobalt kernel: [226379.087568] [<ffffffff80273deb>] out_of_memory+0x1f5/0x28e
Oct 4 22:25:19 SunCobalt kernel: [226379.087575] [<ffffffff80276b3c>] __alloc_pages_internal+0x31d/0x3bf
Oct 4 22:25:19 SunCobalt kernel: [226379.087584] [<ffffffff802787f2>] __do_page_cache_readahead+0x79/0x183
Oct 4 22:25:19 SunCobalt kernel: [226379.087590] [<ffffffff802730a1>] filemap_fault+0x15d/0x33c
Oct 4 22:25:19 SunCobalt kernel: [226379.087597] [<ffffffff8027e620>] __do_fault+0x50/0x3e6
Oct 4 22:25:19 SunCobalt kernel: [226379.087606] [<ffffffff80281983>] handle_mm_fault+0x3f4/0x867
Oct 4 22:25:19 SunCobalt kernel: [226379.087612] [<ffffffff802483e0>] enqueue_hrtimer+0xd7/0xe4
Oct 4 22:25:19 SunCobalt kernel: [226379.087619] [<ffffffff80221fbc>] do_page_fault+0x5d8/0x9c8
Oct 4 22:25:19 SunCobalt kernel: [226379.087623] [<ffffffff802385de>] do_setitimer+0x163/0x338
Oct 4 22:25:19 SunCobalt kernel: [226379.087631] [<ffffffff8042a869>] error_exit+0x0/0x60
Oct 4 22:25:19 SunCobalt kernel: [226379.087640]
Oct 4 22:25:19 SunCobalt kernel: [226379.087641] Mem-info:
Oct 4 22:25:19 SunCobalt kernel: [226379.087643] Node 0 DMA per-cpu:
Oct 4 22:25:19 SunCobalt kernel: [226379.087646] CPU 0: hi: 0, btch: 1 usd: 0
Oct 4 22:25:19 SunCobalt kernel: [226379.087648] CPU 1: hi: 0, btch: 1 usd: 0
Oct 4 22:25:19 SunCobalt kernel: [226379.087650] Node 0 DMA32 per-cpu:
Oct 4 22:25:19 SunCobalt kernel: [226379.087653] CPU 0: hi: 186, btch: 31 usd: 145
Oct 4 22:25:19 SunCobalt kernel: [226379.087655] CPU 1: hi: 186, btch: 31 usd: 129
Oct 4 22:25:19 SunCobalt kernel: [226379.087659] Active:158468 inactive:81472 dirty:0 writeback:0 unstable:0
Oct 4 22:25:19 SunCobalt kernel: [226379.087660] free:2045 slab:4913 mapped:1 pagetables:4652 bounce:0
Oct 4 22:25:19 SunCobalt kernel: [226379.087663] Node 0 DMA free:3996kB min:40kB low:48kB high:60kB active:3748kB inactive:3484kB present:10792kB pages_scan
ned:14650 all_unreclaimable? yes
Oct 4 22:25:19 SunCobalt kernel: [226379.087667] lowmem_reserve[]: 0 992 992 992
Oct 4 22:25:19 SunCobalt kernel: [226379.087671] Node 0 DMA32 free:4184kB min:4008kB low:5008kB high:6012kB active:630324kB inactive:322276kB present:101662
8kB pages_scanned:2870101 all_unreclaimable? yes
Oct 4 22:25:19 SunCobalt kernel: [226379.087677] lowmem_reserve[]: 0 0 0 0
Oct 4 22:25:19 SunCobalt kernel: [226379.087680] Node 0 DMA: 3*4kB 2*8kB 0*16kB 0*32kB 0*64kB 1*128kB 1*256kB 1*512kB 1*1024kB 1*2048kB 0*4096kB = 3996kB
Oct 4 22:25:19 SunCobalt kernel: [226379.087690] Node 0 DMA32: 100*4kB 3*8kB 1*16kB 1*32kB 0*64kB 1*128kB 0*256kB 1*512kB 1*1024kB 1*2048kB 0*4096kB = 4184kB
Oct 4 22:25:19 SunCobalt kernel: [226379.087700] 58 total pagecache pages
Oct 4 22:25:19 SunCobalt kernel: [226379.087702] Swap cache: add 2507327, delete 2507325, find 22040872/22165924
Oct 4 22:25:19 SunCobalt kernel: [226379.087705] Free swap = 0kB
Oct 4 22:25:19 SunCobalt kernel: [226379.087706] Total swap = 3004112kB
Oct 4 22:25:19 SunCobalt kernel: [226379.092304] 261776 pages of RAM
Oct 4 22:25:19 SunCobalt kernel: [226379.092304] 4787 reserved pages
Oct 4 22:25:19 SunCobalt kernel: [226379.092304] 2511 pages shared
Oct 4 22:25:19 SunCobalt kernel: [226379.092304] 2 pages swap cached
Oct 4 22:26:49 SunCobalt kernel: [226465.806076] udevd invoked oom-killer: gfp_mask=0x1201d2, order=0, oomkilladj=-17
Oct 4 22:27:45 SunCobalt kernel: [226465.806082] Pid: 15490, comm: udevd Not tainted 2.6.26-2-amd64 #1
Oct 4 22:27:49 SunCobalt kernel: [226465.806085]
Oct 4 22:27:49 SunCobalt kernel: [226465.806085] Call Trace:
Oct 4 22:27:49 SunCobalt kernel: [226465.806111] [<ffffffff8027388c>] oom_kill_process+0x57/0x1dc
Oct 4 22:27:49 SunCobalt kernel: [226465.806116] [<ffffffff8023b49d>] __capable+0x9/0x1c
Oct 4 22:27:49 SunCobalt kernel: [226465.806119] [<ffffffff80273bb7>] badness+0x188/0x1c7
Oct 4 22:27:49 SunCobalt kernel: [226465.806124] [<ffffffff80273deb>] out_of_memory+0x1f5/0x28e
Oct 4 22:27:49 SunCobalt kernel: [226465.806131] [<ffffffff80276b3c>] __alloc_pages_internal+0x31d/0x3bf
Oct 4 22:27:49 SunCobalt kernel: [226465.806140] [<ffffffff802787f2>] __do_page_cache_readahead+0x79/0x183
Oct 4 22:27:49 SunCobalt kernel: [226465.806146] [<ffffffff802730a1>] filemap_fault+0x15d/0x33c
Oct 4 22:27:49 SunCobalt kernel: [226465.806153] [<ffffffff8027e620>] __do_fault+0x50/0x3e6
Oct 4 22:27:49 SunCobalt kernel: [226465.806162] [<ffffffff80281983>] handle_mm_fault+0x3f4/0x867
Oct 4 22:27:49 SunCobalt kernel: [226465.806170] [<ffffffff803b2be7>] sk_prot_alloc+0x46/0xa4
Oct 4 22:27:49 SunCobalt kernel: [226465.806177] [<ffffffff80221fbc>] do_page_fault+0x5d8/0x9c8
Oct 4 22:27:49 SunCobalt kernel: [226465.806185] [<ffffffff8029960d>] fd_install+0x25/0x56
Oct 4 22:27:49 SunCobalt kernel: [226465.806190] [<ffffffff8042a869>] error_exit+0x0/0x60
Oct 4 22:27:49 SunCobalt kernel: [226465.806199]
Oct 4 22:27:49 SunCobalt kernel: [226465.806200] Mem-info:
Oct 4 22:27:49 SunCobalt kernel: [226465.806202] Node 0 DMA per-cpu:
Oct 4 22:27:49 SunCobalt kernel: [226465.806205] CPU 0: hi: 0, btch: 1 usd: 0
Oct 4 22:27:49 SunCobalt kernel: [226465.806207] CPU 1: hi: 0, btch: 1 usd: 0
Oct 4 22:27:49 SunCobalt kernel: [226465.806209] Node 0 DMA32 per-cpu:
Oct 4 22:27:49 SunCobalt kernel: [226465.806212] CPU 0: hi: 186, btch: 31 usd: 142
Oct 4 22:27:49 SunCobalt kernel: [226465.806214] CPU 1: hi: 186, btch: 31 usd: 184
Oct 4 22:27:49 SunCobalt kernel: [226465.806218] Active:231859 inactive:7989 dirty:0 writeback:0 unstable:0
Oct 4 22:27:49 SunCobalt kernel: [226465.806219] free:2001 slab:4944 mapped:1 pagetables:4759 bounce:0
Oct 4 22:27:49 SunCobalt kernel: [226465.806221] Node 0 DMA free:4000kB min:40kB low:48kB high:60kB active:4168kB inactive:3088kB present:10792kB pages_scan
ned:11079 all_unreclaimable? yes
Oct 4 22:27:49 SunCobalt kernel: [226465.806227] lowmem_reserve[]: 0 992 992 992
Oct 4 22:27:49 SunCobalt kernel: [226465.806230] Node 0 DMA32 free:4004kB min:4008kB low:5008kB high:6012kB active:923368kB inactive:28868kB present:1016628
kB pages_scanned:97829 all_unreclaimable? no
Oct 4 22:27:49 SunCobalt kernel: [226465.806236] lowmem_reserve[]: 0 0 0 0
Oct 4 22:27:49 SunCobalt kernel: [226465.806240] Node 0 DMA: 4*4kB 2*8kB 0*16kB 0*32kB 0*64kB 1*128kB 1*256kB 1*512kB 1*1024kB 1*2048kB 0*4096kB = 4000kB
Oct 4 22:27:49 SunCobalt kernel: [226465.806250] Node 0 DMA32: 46*4kB 0*8kB 0*16kB 2*32kB 0*64kB 1*128kB 0*256kB 1*512kB 1*1024kB 1*2048kB 0*4096kB = 3960kB
Oct 4 22:27:49 SunCobalt kernel: [226465.806259] 69 total pagecache pages
Oct 4 22:27:49 SunCobalt kernel: [226465.806262] Swap cache: add 2511090, delete 2511090, find 22042451/22167980
Oct 4 22:27:49 SunCobalt kernel: [226465.806264] Free swap = 0kB
Oct 4 22:27:49 SunCobalt kernel: [226465.806266] Total swap = 3004112kB
Oct 4 22:27:49 SunCobalt kernel: [226465.811137] 261776 pages of RAM
Oct 4 22:27:49 SunCobalt kernel: [226465.811140] 4787 reserved pages
Oct 4 22:27:49 SunCobalt kernel: [226465.811141] 2693 pages shared
Oct 4 22:27:49 SunCobalt kernel: [226465.811143] 0 pages swap cached
Oct 4 22:27:49 SunCobalt kernel: [226477.625344] init invoked oom-killer: gfp_mask=0x1201d2, order=0, oomkilladj=0
Oct 4 22:27:49 SunCobalt kernel: [226477.625350] Pid: 1, comm: init Not tainted 2.6.26-2-amd64 #1
Oct 4 22:27:49 SunCobalt kernel: [226477.625352]
Oct 4 22:27:49 SunCobalt kernel: [226477.625353] Call Trace:
Oct 4 22:27:49 SunCobalt kernel: [226477.625378] [<ffffffff8027388c>] oom_kill_process+0x57/0x1dc
Oct 4 22:27:49 SunCobalt kernel: [226477.625383] [<ffffffff8023b49d>] __capable+0x9/0x1c
Oct 4 22:27:49 SunCobalt kernel: [226477.625386] [<ffffffff80273bb7>] badness+0x188/0x1c7
Oct 4 22:27:49 SunCobalt kernel: [226477.625391] [<ffffffff80273deb>] out_of_memory+0x1f5/0x28e
Oct 4 22:27:49 SunCobalt kernel: [226477.625398] [<ffffffff80276b3c>] __alloc_pages_internal+0x31d/0x3bf
Oct 4 22:27:49 SunCobalt kernel: [226477.625407] [<ffffffff802787f2>] __do_page_cache_readahead+0x79/0x183
Oct 4 22:27:49 SunCobalt kernel: [226477.625414] [<ffffffff802730a1>] filemap_fault+0x15d/0x33c
Oct 4 22:27:49 SunCobalt kernel: [226477.625421] [<ffffffff8027e620>] __do_fault+0x50/0x3e6
Oct 4 22:27:49 SunCobalt kernel: [226477.625429] [<ffffffff80281983>] handle_mm_fault+0x3f4/0x867
Oct 4 22:27:49 SunCobalt kernel: [226477.625440] [<ffffffff80221fbc>] do_page_fault+0x5d8/0x9c8
Oct 4 22:27:49 SunCobalt kernel: [226477.625449] [<ffffffff8042a869>] error_exit+0x0/0x60
Oct 4 22:27:49 SunCobalt kernel: [226477.625458]
Oct 4 22:27:49 SunCobalt kernel: [226477.625459] Mem-info:
Oct 4 22:27:49 SunCobalt kernel: [226477.625461] Node 0 DMA per-cpu:
Oct 4 22:27:49 SunCobalt kernel: [226477.625464] CPU 0: hi: 0, btch: 1 usd: 0
Oct 4 22:27:49 SunCobalt kernel: [226477.625467] CPU 1: hi: 0, btch: 1 usd: 0
Oct 4 22:27:49 SunCobalt kernel: [226477.625468] Node 0 DMA32 per-cpu:
Oct 4 22:27:49 SunCobalt kernel: [226477.625471] CPU 0: hi: 186, btch: 31 usd: 154
Oct 4 22:27:49 SunCobalt kernel: [226477.625473] CPU 1: hi: 186, btch: 31 usd: 178
Oct 4 22:27:49 SunCobalt kernel: [226477.625477] Active:84214 inactive:155688 dirty:0 writeback:0 unstable:0
Oct 4 22:27:49 SunCobalt kernel: [226477.625478] free:1987 slab:4944 mapped:32 pagetables:4672 bounce:0
Oct 4 22:27:49 SunCobalt kernel: [226477.625481] Node 0 DMA free:4004kB min:40kB low:48kB high:60kB active:3960kB inactive:3324kB present:10792kB pages_scan
ned:12288 all_unreclaimable? yes
Oct 4 22:27:49 SunCobalt kernel: [226477.625486] lowmem_reserve[]: 0 992 992 992
Oct 4 22:27:49 SunCobalt kernel: [226477.625490] Node 0 DMA32 free:3944kB min:4008kB low:5008kB high:6012kB active:332896kB inactive:619428kB present:101662
8kB pages_scanned:1024 all_unreclaimable? no
Oct 4 22:27:49 SunCobalt kernel: [226477.625496] lowmem_reserve[]: 0 0 0 0
Oct 4 22:27:49 SunCobalt kernel: [226477.625499] Node 0 DMA: 5*4kB 2*8kB 0*16kB 0*32kB 0*64kB 1*128kB 1*256kB 1*512kB 1*1024kB 1*2048kB 0*4096kB = 4004kB
Oct 4 22:27:49 SunCobalt kernel: [226477.625509] Node 0 DMA32: 48*4kB 0*8kB 0*16kB 2*32kB 0*64kB 1*128kB 0*256kB 1*512kB 1*1024kB 1*2048kB 0*4096kB = 3968kB
Oct 4 22:27:49 SunCobalt kernel: [226477.625518] 239 total pagecache pages
Oct 4 22:27:49 SunCobalt kernel: [226477.625521] Swap cache: add 2511170, delete 2511170, find 22042453/22167991
Oct 4 22:27:49 SunCobalt kernel: [226477.625523] Free swap = 0kB
Oct 4 22:27:49 SunCobalt kernel: [226477.625525] Total swap = 3004112kB
Oct 4 22:27:49 SunCobalt kernel: [226477.630381] 261776 pages of RAM
Oct 4 22:27:49 SunCobalt kernel: [226477.630384] 4787 reserved pages
Oct 4 22:27:49 SunCobalt kernel: [226477.630385] 2685 pages shared
Oct 4 22:27:49 SunCobalt kernel: [226477.630387] 0 pages swap cached
Oct 4 22:27:49 SunCobalt kernel: [226517.404982] udevd invoked oom-killer: gfp_mask=0x1200d2, order=0, oomkilladj=-17
Oct 4 22:27:49 SunCobalt kernel: [226517.404988] Pid: 15494, comm: udevd Not tainted 2.6.26-2-amd64 #1
Oct 4 22:27:49 SunCobalt kernel: [226517.404990]
Oct 4 22:27:49 SunCobalt kernel: [226517.404991] Call Trace:
Oct 4 22:27:49 SunCobalt kernel: [226517.405016] [<ffffffff8027388c>] oom_kill_process+0x57/0x1dc
Oct 4 22:27:49 SunCobalt kernel: [226517.405021] [<ffffffff8023b49d>] __capable+0x9/0x1c
Oct 4 22:27:49 SunCobalt kernel: [226517.405025] [<ffffffff80273bb7>] badness+0x188/0x1c7
Oct 4 22:27:49 SunCobalt kernel: [226517.405029] [<ffffffff80273deb>] out_of_memory+0x1f5/0x28e
Oct 4 22:27:49 SunCobalt kernel: [226517.405036] [<ffffffff80276b3c>] __alloc_pages_internal+0x31d/0x3bf
Oct 4 22:27:49 SunCobalt kernel: [226517.405046] [<ffffffff8028a451>] read_swap_cache_async+0x48/0xc2
Oct 4 22:27:49 SunCobalt kernel: [226517.405052] [<ffffffff8028a522>] swapin_readahead+0x57/0x98
Oct 4 22:27:49 SunCobalt kernel: [226517.405058] [<ffffffff80281a38>] handle_mm_fault+0x4a9/0x867
Oct 4 22:27:49 SunCobalt kernel: [226517.405064] [<ffffffff802483e0>] enqueue_hrtimer+0xd7/0xe4
Oct 4 22:27:49 SunCobalt kernel: [226517.405072] [<ffffffff80221fbc>] do_page_fault+0x5d8/0x9c8
Oct 4 22:27:49 SunCobalt kernel: [226517.405076] [<ffffffff802385de>] do_setitimer+0x163/0x338
Oct 4 22:27:49 SunCobalt kernel: [226517.405084] [<ffffffff8042a869>] error_exit+0x0/0x60
Oct 4 22:27:49 SunCobalt kernel: [226517.405093]
Oct 4 22:27:49 SunCobalt kernel: [226517.405094] Mem-info:
Oct 4 22:27:49 SunCobalt kernel: [226517.405096] Node 0 DMA per-cpu:
Oct 4 22:27:49 SunCobalt kernel: [226517.405099] CPU 0: hi: 0, btch: 1 usd: 0
Oct 4 22:27:49 SunCobalt kernel: [226517.405102] CPU 1: hi: 0, btch: 1 usd: 0
Oct 4 22:27:49 SunCobalt kernel: [226517.405103] Node 0 DMA32 per-cpu:
Oct 4 22:27:49 SunCobalt kernel: [226517.405106] CPU 0: hi: 186, btch: 31 usd: 156
Oct 4 22:27:49 SunCobalt kernel: [226517.405108] CPU 1: hi: 186, btch: 31 usd: 167
Oct 4 22:27:49 SunCobalt kernel: [226517.405112] Active:120227 inactive:119276 dirty:0 writeback:0 unstable:0
Oct 4 22:27:49 SunCobalt kernel: [226517.405114] free:2059 slab:4934 mapped:6 pagetables:4635 bounce:0
Oct 4 22:27:49 SunCobalt kernel: [226517.405116] Node 0 DMA free:4004kB min:40kB low:48kB high:60kB active:3684kB inactive:3592kB present:10792kB pages_scan
ned:11399 all_unreclaimable? yes
Oct 4 22:27:49 SunCobalt kernel: [226517.405121] lowmem_reserve[]: 0 992 992 992
Oct 4 22:27:49 SunCobalt kernel: [226517.405125] Node 0 DMA32 free:4232kB min:4008kB low:5008kB high:6012kB active:477224kB inactive:473512kB present:101662
8kB pages_scanned:1084762 all_unreclaimable? no
Oct 4 22:27:49 SunCobalt kernel: [226517.405131] lowmem_reserve[]: 0 0 0 0
Oct 4 22:27:49 SunCobalt kernel: [226517.405134] Node 0 DMA: 5*4kB 2*8kB 0*16kB 0*32kB 0*64kB 1*128kB 1*256kB 1*512kB 1*1024kB 1*2048kB 0*4096kB = 4004kB
Oct 4 22:27:49 SunCobalt kernel: [226517.405144] Node 0 DMA32: 120*4kB 1*8kB 0*16kB 1*32kB 0*64kB 1*128kB 0*256kB 1*512kB 1*1024kB 1*2048kB 0*4096kB = 4232k
B
Oct 4 22:27:49 SunCobalt kernel: [226517.405154] 49 total pagecache pages
Oct 4 22:27:49 SunCobalt kernel: [226517.405156] Swap cache: add 2512266, delete 2512265, find 22042933/22168611
Oct 4 22:27:49 SunCobalt kernel: [226517.405159] Free swap = 0kB
Oct 4 22:27:49 SunCobalt kernel: [226517.405160] Total swap = 3004112kB
Oct 4 22:27:49 SunCobalt kernel: [226517.410019] 261776 pages of RAM
Oct 4 22:27:49 SunCobalt kernel: [226517.410022] 4787 reserved pages
Oct 4 22:27:49 SunCobalt kernel: [226517.410023] 2894 pages shared
Oct 4 22:27:50 SunCobalt kernel: [226517.410025] 1 pages swap cached
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] udevd invoked oom-killer: gfp_mask=0x1201d2, order=0, oomkilladj=-17
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] Pid: 15490, comm: udevd Not tainted 2.6.26-2-amd64 #1
Oct 4 22:28:53 SunCobalt kernel: [226610.682187]
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] Call Trace:
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] [<ffffffff8027388c>] oom_kill_process+0x57/0x1dc
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] [<ffffffff8023b49d>] __capable+0x9/0x1c
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] [<ffffffff80273bb7>] badness+0x188/0x1c7
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] [<ffffffff80273deb>] out_of_memory+0x1f5/0x28e
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] [<ffffffff80276b3c>] __alloc_pages_internal+0x31d/0x3bf
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] [<ffffffff802787f2>] __do_page_cache_readahead+0x79/0x183
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] [<ffffffff802730a1>] filemap_fault+0x15d/0x33c
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] [<ffffffff8027e620>] __do_fault+0x50/0x3e6
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] [<ffffffff80281983>] handle_mm_fault+0x3f4/0x867
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] [<ffffffff80221fbc>] do_page_fault+0x5d8/0x9c8
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] [<ffffffff8042a869>] error_exit+0x0/0x60
Oct 4 22:28:53 SunCobalt kernel: [226610.682187]
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] Mem-info:
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] Node 0 DMA per-cpu:
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] CPU 0: hi: 0, btch: 1 usd: 0
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] CPU 1: hi: 0, btch: 1 usd: 0
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] Node 0 DMA32 per-cpu:
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] CPU 0: hi: 186, btch: 31 usd: 180
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] CPU 1: hi: 186, btch: 31 usd: 166
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] Active:144971 inactive:94599 dirty:0 writeback:0 unstable:0
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] free:1998 slab:4991 mapped:4 pagetables:4800 bounce:0
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] Node 0 DMA free:4008kB min:40kB low:48kB high:60kB active:3640kB inactive:3688kB present:10792kB pages_scan
ned:12158 all_unreclaimable? yes
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] lowmem_reserve[]: 0 992 992 992
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] Node 0 DMA32 free:3984kB min:4008kB low:5008kB high:6012kB active:576244kB inactive:374820kB present:101662
8kB pages_scanned:3041370 all_unreclaimable? yes
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] lowmem_reserve[]: 0 0 0 0
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] Node 0 DMA: 4*4kB 3*8kB 0*16kB 0*32kB 0*64kB 1*128kB 1*256kB 1*512kB 1*1024kB 1*2048kB 0*4096kB = 4008kB
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] Node 0 DMA32: 62*4kB 1*8kB 1*16kB 0*32kB 0*64kB 1*128kB 0*256kB 1*512kB 1*1024kB 1*2048kB 0*4096kB = 3984kB
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] 62 total pagecache pages
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] Swap cache: add 2515705, delete 2515705, find 22044699/22170817
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] Free swap = 0kB
Oct 4 22:28:53 SunCobalt kernel: [226610.682187] Total swap = 3004112kB
Oct 4 22:28:53 SunCobalt kernel: [226610.686356] 261776 pages of RAM
Oct 4 22:28:53 SunCobalt kernel: [226610.686358] 4787 reserved pages
Oct 4 22:28:53 SunCobalt kernel: [226610.686360] 3032 pages shared
Oct 4 22:28:53 SunCobalt kernel: [226610.686362] 0 pages swap cached
Oct 4 22:32:33 SunCobalt shutdown[16235]: shutting down for system reboot
Oct 4 22:34:57 SunCobalt kernel: [226976.434271] Bluetooth: L2CAP ver 2.9
Oct 4 22:34:57 SunCobalt kernel: [226976.434271] Bluetooth: L2CAP socket layer initialized
Oct 4 22:34:57 SunCobalt kernel: [226976.438599] Bluetooth: RFCOMM socket layer initialized
Oct 4 22:34:57 SunCobalt kernel: [226976.438599] Bluetooth: RFCOMM TTY layer initialized
Oct 4 22:34:57 SunCobalt kernel: [226976.438599] Bluetooth: RFCOMM ver 1.8
Oct 4 22:34:58 SunCobalt kernel: Kernel logging (proc) stopped.



/var/log/apache2/error.log (damals noch mit log level warn)


[Mon Oct 04 22:17:23 2010] [error] [client 192.168.178.24] mod_wsgi (pid=1106): Exception occurred processing WSGI script '/var/www/wms.wsgi'.
[Mon Oct 04 22:17:23 2010] [error] [client 192.168.178.24] IOError: failed to write data
[Mon Oct 04 22:29:14 2010] [error] [client 192.168.178.24] mod_wsgi (pid=1104): Exception occurred processing WSGI script '/var/www/wms.wsgi'.
[Mon Oct 04 22:29:19 2010] [error] [client 192.168.178.24] IOError: failed to write data
[Mon Oct 04 22:29:45 2010] [error] [client 192.168.178.24] mod_wsgi (pid=1103): Exception occurred processing WSGI script '/var/www/wms.wsgi'.
[Mon Oct 04 22:29:50 2010] [error] [client 192.168.178.24] IOError: failed to write data

....bis

[Mon Oct 04 22:34:30 2010] [warn] child process 20496 still did not exit, sending a SIGTERM
[Mon Oct 04 22:34:32 2010] [warn] child process 23031 still did not exit, sending a SIGTERM
[Mon Oct 04 22:34:32 2010] [warn] child process 20492 still did not exit, sending a SIGTERM
[Mon Oct 04 22:34:32 2010] [warn] child process 15491 still did not exit, sending a SIGTERM
[Mon Oct 04 22:34:32 2010] [warn] child process 1103 still did not exit, sending a SIGTERM
[Mon Oct 04 22:34:32 2010] [warn] child process 1105 still did not exit, sending a SIGTERM
[Mon Oct 04 22:34:32 2010] [warn] child process 1106 still did not exit, sending a SIGTERM
[Mon Oct 04 22:34:32 2010] [warn] child process 20493 still did not exit, sending a SIGTERM
[Mon Oct 04 22:34:32 2010] [warn] child process 20494 still did not exit, sending a SIGTERM
[Mon Oct 04 22:34:32 2010] [warn] child process 15499 still did not exit, sending a SIGTERM
[Mon Oct 04 22:34:32 2010] [warn] child process 15514 still did not exit, sending a SIGTERM
[Mon Oct 04 22:34:32 2010] [warn] child process 15542 still did not exit, sending a SIGTERM


....bis
[Mon Oct 04 22:34:36 2010] [error] could not make child process 20492 exit, attempting to continue anyway
[Mon Oct 04 22:34:37 2010] [notice] caught SIGTERM, shutting down



Anbei meine apache.conf. Die Kommentare habe ich zur besseren lesbarkeit entfernt.


ServerRoot "/etc/apache2"


LockFile /var/lock/apache2/accept.lock

PidFile ${APACHE_PID_FILE}

Timeout 300


KeepAlive On


MaxKeepAliveRequests 100

KeepAliveTimeout 15


<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 500
</IfModule>


<IfModule mpm_worker_module>
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 500
</IfModule>


User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}


AccessFileName .htaccess

<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>


DefaultType text/plain


HostnameLookups Off


ErrorLog /var/log/apache2/error.log


LogLevel info


Include /etc/apache2/mods-enabled/*.load
Include /etc/apache2/mods-enabled/*.conf

Include /etc/apache2/httpd.conf


Include /etc/apache2/ports.conf


LogFormat "%v:%p %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent


CustomLog /var/log/apache2/other_vhosts_access.log vhost_combined


Include /etc/apache2/conf.d/

Include /etc/apache2/sites-enabled/

<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>


Die httpd.conf ist leer in

Im Verzeichnis /etc/apache2/mods-enabled stehen die folgenden Dateien:
alias.conf authz_default.load autoindex.conf dav_fs.load dir.conf mime.load php5.load status.conf
alias.load authz_groupfile.load autoindex.load dav.load dir.load negotiation.conf rewrite.load status.load
auth_basic.load authz_host.load cgi.load deflate.conf env.load negotiation.load setenvif.conf wsgi.conf
authn_file.load authz_user.load dav_fs.conf deflate.load mime.conf php5.conf setenvif.load wsgi.load


top und free kann ich gerade nicht reinkopieren. Ich habe Apache heute morgen neu gestartet. Danach ist der Speicher wieder frei gewesen. Ich kann Apache/Mapserver heute Abend mal ein wenig beschäftigen, falls die Ausgaben von top und free wichtig sind. In Top standen heute morgen so ca.10 Apache-Prozesse, die alle so 7-13% des Speichers verbraucht haben. In den den Logs steht nichts (/var/log/messages), da der Rechner nicht abgestürzt ist bzw wenig (Apache error.log)


[Sun Oct 10 19:31:58 2010] [info] mod_wsgi (pid=29058): Attach interpreter ''.
[Sun Oct 10 19:31:58 2010] [info] mod_wsgi (pid=29059): Attach interpreter ''.
[Sun Oct 10 19:35:07 2010] [info] mod_wsgi (pid=17486): Destroy interpreter 'xxx.xxxxx.net|/wms'.
[Sun Oct 10 19:35:09 2010] [info] mod_wsgi (pid=23439): Destroy interpreter 'xxx.xxxxx.net|/wms'.
[Sun Oct 10 19:35:09 2010] [info] mod_wsgi (pid=23439): Cleanup interpreter ''.
[Sun Oct 10 19:35:09 2010] [info] mod_wsgi (pid=23439): Terminating Python.
[Sun Oct 10 19:35:09 2010] [info] mod_wsgi (pid=29057): Cleanup interpreter ''.
[Sun Oct 10 19:35:09 2010] [info] mod_wsgi (pid=17486): Cleanup interpreter ''.
[Sun Oct 10 19:35:09 2010] [info] mod_wsgi (pid=29057): Terminating Python.
[Sun Oct 10 19:35:10 2010] [info] mod_wsgi (pid=17486): Terminating Python.
[Sun Oct 10 19:35:15 2010] [info] mod_wsgi (pid=29059): Create interpreter 'xxx.xxxxx.net|/wms'.
[Sun Oct 10 19:36:57 2010] [info] mod_wsgi (pid=29728): Attach interpreter ''.
[Sun Oct 10 19:36:58 2010] [info] mod_wsgi (pid=29730): Attach interpreter ''.
[Sun Oct 10 19:36:58 2010] [info] mod_wsgi (pid=29729): Attach interpreter ''.
[Sun Oct 10 19:37:14 2010] [info] mod_wsgi (pid=29059): Destroy interpreter 'xxx.xxxxx.net|/wms'.
[Sun Oct 10 19:37:14 2010] [info] mod_wsgi (pid=29059): Cleanup interpreter ''.
[Sun Oct 10 19:37:14 2010] [info] mod_wsgi (pid=29059): Terminating Python.
[Sun Oct 10 19:37:15 2010] [info] mod_wsgi (pid=25844): Destroy interpreter 'xxx.xxxxx.net|/wms'.
[Sun Oct 10 19:37:15 2010] [info] mod_wsgi (pid=25844): Cleanup interpreter ''.
[Sun Oct 10 19:37:15 2010] [info] mod_wsgi (pid=25844): Terminating Python.
[Sun Oct 10 19:37:16 2010] [info] mod_wsgi (pid=29728): Cleanup interpreter ''.
[Sun Oct 10 19:37:16 2010] [info] mod_wsgi (pid=29728): Terminating Python.
[Sun Oct 10 19:38:13 2010] [info] mod_wsgi (pid=29729): Create interpreter 'xxx.xxxxx.net|/wms'.
[Sun Oct 10 19:38:16 2010] [info] mod_wsgi (pid=29730): Create interpreter 'xxx.xxxxx.net|/wms'.
[Sun Oct 10 19:40:37 2010] [info] mod_wsgi (pid=29058): Create interpreter 'xxx.xxxxx.net|/wms'.

marce
11.10.10, 08:57
auf den ersten Blick (und nochmals mit der Bitte um die weiteren Ausgaben):

KeepAlive On


MaxKeepAliveRequests 100

KeepAliveTimeout 15


<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 500
</IfModule>


<IfModule mpm_worker_module>
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 500
</IfModule>


ist für 3 Clients sehr hoch gesetzt. Dann kommt's noch drauf an, was an Modulen in dem Apache so alles drin ist...

Zu überlegen wäre auch noch, ob Du keep-Alive wirklich brauchst...

Zoba
11.10.10, 10:12
vielen Dank schonmal für Deine Hilfe. Anbei noch die gewünschten Angaben für top und free, einmal vor und einmal nach Last, sowie die geladenen Module. Die von Dir markierten Werte kann ich mal runtersetzen, wenn es helfen würde.



top - 09:58:44 up 1 day, 20:32, 1 user, load average: 0.00, 0.00, 0.00
Tasks: 98 total, 1 running, 97 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 1027956k total, 297312k used, 730644k free, 82640k buffers
Swap: 3004112k total, 36968k used, 2967144k free, 124948k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
7372 root 20 0 185m 10m 5128 S 0 1.1 0:00.24 apache2
7379 www-data 20 0 185m 8036 1864 S 0 0.8 0:00.02 apache2
7642 www-data 20 0 185m 8020 1864 S 0 0.8 0:00.02 apache2
7640 www-data 20 0 185m 8012 1864 S 0 0.8 0:00.00 apache2
7382 www-data 20 0 185m 8004 1872 S 0 0.8 0:00.00 apache2
7378 www-data 20 0 185m 7968 1864 S 0 0.8 0:00.00 apache2
7380 www-data 20 0 185m 7840 1864 S 0 0.8 0:00.02 apache2
10999 www-data 20 0 185m 7836 1864 S 0 0.8 0:00.00 apache2
7381 www-data 20 0 185m 7628 1704 S 0 0.7 0:00.00 apache2
10658 www-data 20 0 185m 7624 1700 S 0 0.7 0:00.00 apache2
11325 www-data 20 0 185m 7604 1684 S 0 0.7 0:00.00 apache2
13835 root 30 10 75684 6884 1480 S 0 0.7 0:19.72 python
2818 mysql 20 0 157m 4740 2176 S 0 0.5 0:47.41 mysqld
22210 thomas 20 0 20920 3792 1432 S 0 0.4 0:00.14 bash
3043 root 20 0 35260 3752 1532 S 0 0.4 0:04.48 ddclient
19483 root 20 0 41784 3100 1620 S 0 0.3 0:08.90 munin-node
22201 root 20 0 67984 3024 2408 S 0 0.3 0:00.04 sshd
3357 haldaemo 20 0 29532 2168 1528 S 0 0.2 0:31.38 hald
22209 thomas 20 0 67984 1688 1064 S 0 0.2 0:00.00 sshd
2980 root 20 0 71612 1628 1296 S 0 0.2 0:00.02 cupsd
3403 root 20 0 47340 1572 1416 S 0 0.2 0:06.76 NetworkManager
2681 root 20 0 119m 1380 996 S 0 0.1 0:00.56 rsyslogd
2714 avahi 20 0 31724 1264 1108 S 0 0.1 0:00.88 avahi-daemon
22223 thomas 20 0 18824 1252 940 R 1 0.1 0:00.08 top
2781 root 20 0 17312 1152 1148 S 0 0.1 0:00.00 mysqld_safe
3411 root 20 0 24108 1116 1112 S 0 0.1 0:00.00 NetworkManagerD
3358 root 20 0 17772 1056 932 S 0 0.1 0:07.40 hald-runner
3392 root 20 0 19884 984 908 S 0 0.1 0:07.36 hald-addon-stor
3386 root 20 0 19884 976 900 S 0 0.1 0:25.16 hald-addon-stor
2702 messageb 20 0 21220 948 660 S 0 0.1 0:34.06 dbus-daemon
3376 root 20 0 19884 916 912 S 0 0.1 0:00.00 hald-addon-inpu
3379 root 20 0 19896 888 884 S 0 0.1 0:00.00 hald-addon-cpuf
3501 root 20 0 19832 872 776 S 0 0.1 0:00.30 cron
3333 root 20 0 61200 840 712 S 0 0.1 0:09.62 kerneloops
3444 root 20 0 26564 836 832 S 0 0.1 0:00.00 system-tools-ba
3380 haldaemo 20 0 16604 828 824 S 0 0.1 0:00.02 hald-addon-acpi
2732 root 20 0 48864 756 632 S 0 0.1 0:00.00 sshd






total used free shared buffers cached
Mem: 1027956 297496 730460 0 83208 124960
-/+ buffers/cache: 89328 938628
Swap: 3004112 36968 2967144





Ich habe mal etwas Last simuliert und danach Apache 15 Minuten ausruhen lassen. Wie man sehen kann, ist der Speicherverbrauch von Apache trotz null Last recht hoch



top - 11:08:52 up 1 day, 21:42, 1 user, load average: 0.02, 0.03, 0.02
Tasks: 98 total, 1 running, 97 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.2%us, 0.2%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 1027956k total, 815860k used, 212096k free, 4656k buffers
Swap: 3004112k total, 163416k used, 2840696k free, 42876k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
26163 www-data 20 0 419m 128m 12m S 0 12.8 0:06.48 apache2
10658 www-data 20 0 445m 124m 12m S 0 12.4 0:10.88 apache2
25213 www-data 20 0 414m 122m 12m S 0 12.3 0:09.10 apache2
25214 www-data 20 0 411m 120m 12m S 0 12.0 0:07.82 apache2
7382 www-data 20 0 432m 111m 12m S 0 11.1 0:10.62 apache2
25215 www-data 20 0 369m 78m 12m S 0 7.8 0:04.02 apache2
7379 www-data 20 0 395m 54m 12m S 0 5.4 0:04.58 apache2
26159 www-data 20 0 325m 33m 12m S 0 3.4 0:00.72 apache2
25721 www-data 20 0 320m 29m 12m S 0 2.9 0:00.38 apache2
26164 www-data 20 0 320m 29m 12m S 0 2.9 0:00.44 apache2
7372 root 20 0 185m 9524 4408 S 0 0.9 0:00.34 apache2
13835 root 30 10 75684 6644 1324 S 0 0.6 0:20.68 python
2818 mysql 20 0 157m 4720 2156 S 1 0.5 0:48.80 mysqld
3043 root 20 0 35260 3756 1532 S 0 0.4 0:04.60 ddclient
19483 root 20 0 41784 2876 1620 S 0 0.3 0:09.16 munin-node
23566 root 20 0 67984 2428 2408 S 0 0.2 0:00.02 sshd
3357 haldaemo 20 0 29532 2168 1528 S 1 0.2 0:32.18 hald
23578 thomas 20 0 20920 1768 1432 S 0 0.2 0:00.14 bash
3403 root 20 0 47340 1572 1416 S 0 0.2 0:06.96 NetworkManager
2980 root 20 0 71612 1332 1024 S 0 0.1 0:00.02 cupsd
2681 root 20 0 119m 1276 892 S 0 0.1 0:00.62 rsyslogd
28304 thomas 20 0 18824 1248 940 R 1 0.1 0:00.04 top
23577 thomas 20 0 68124 1228 1072 S 0 0.1 0:00.04 sshd
2781 root 20 0 17312 1152 1148 S 0 0.1 0:00.00 mysqld_safe
3411 root 20 0 24108 1116 1112 S 0 0.1 0:00.00 NetworkManagerD
2714 avahi 20 0 31724 1108 956 S 0 0.1 0:00.92 avahi-daemon
3358 root 20 0 17772 1056 932 S 0 0.1 0:07.62 hald-runner
3392 root 20 0 19884 984 908 S 0 0.1 0:07.56 hald-addon-stor
3386 root 20 0 19884 976 900 S 0 0.1 0:25.84 hald-addon-stor
2702 messageb 20 0 21220 948 660 S 0 0.1 0:34.96 dbus-daemon
3376 root 20 0 19884 916 912 S 0 0.1 0:00.00 hald-addon-inpu
3379 root 20 0 19896 888 884 S 0 0.1 0:00.00 hald-addon-cpuf
3501 root 20 0 19832 872 776 S 0 0.1 0:00.32 cron
3333 root 20 0 61200 840 712 S 0 0.1 0:09.86 kerneloops
3444 root 20 0 26564 836 832 S 0 0.1 0:00.00 system-tools-ba
3380 haldaemo 20 0 16604 828 824 S 0 0.1 0:00.02 hald-addon-acpi
2732 root 20 0 48864 756 632 S 0 0.1 0:00.00 sshd





total used free shared buffers cached
Mem: 1027956 815852 212104 0 4716 42932
-/+ buffers/cache: 768204 259752
Swap: 3004112 163412 2840700



Folgende Module sind drin
Statisch:
core.c
mod_log_config.c
mod_logio.c
prefork.c
http_core.c
mod_so.c

Dynamisch:
alias
auth_basic
authn_file
authz_default
authz_groupfile
authz_host
authz_user
autoindex
cgi
dav
dav_fs
deflate
dir
env
mime
negotiation
php5
rewrite
setenvif
status
wsgi

Zoba
12.10.10, 19:59
keiner eine Idee oder fehlt noch etwas? :-(

marce
12.10.10, 21:17
haben die Änderungen denn schon was gebracht? Ansonsten - welche der Module brauchst Du denn? 128M für einen Apache-Prozess ist recht viel, ich kenne die eher so um die 15... - entschlacke also man den Indianer auf das minimal notwendige...

Zoba
13.10.10, 16:29
Also ich habe heute mal ein wenig gelesen und etwas rumprobiert.
An den geladenen Modulen liegt es scheinbar nicht.
Jeder Apache Prozeß wächst bis er das in der php.ini angegebene Speicherlimit erreicht hat (und bleibt auch so dick). Oben sieht man schön, dass ein Prozeß 128M erreicht hat. Nach einer Reduktion auf 96M wuchs der Apache Prozeß auch nur bis 96M. Wenn ich raten müsste, wurde ich also auf ein PHP Memory Leak tippen, aber Ahnung habe ich davon nicht wirklich. Wenn ich mir das PHP Change Log der letzten Versionen so anschaue, sehe ich da jede Menge gefixte Memory Leaks.
Da ich das Problem nicht beseitigen kann, muss ich also an den Symptomen rumdoktern. Eine Lösung wäre MaxRequestsPerChild auf 1 zu setzen und gleichzeitig MinSpareServer so erhöhen, dass es für etwa 2 Datenabrufe reicht. Damit wird jeder Apache Prozeß gleich nach Benutzung gekillt und kann gar nicht wachsen. Das funktioniert auch recht gut, wie ich schon probiert habe, geht aber auf die Performance. Zum Glück ist mir die nicht wichtig, da bei meiner Anwendung durch das Laden von einem anderem Webserver eh Wartezeiten von einigen Sekunden enstehen können.
Ich könnte auch mit MaxClients arbeiten (RAM geteilt durch Speicherlimit in php.ini), aber dann würden die dicken Apache Prozesse lange im RAM bleiben.
Oder eine Kombination aus beiden Lösungen verbunden mit einem nächtlichen Restart von Apache.........mal schauen.
Oder ich versuche auf die aktuelle PHP Version zu kommen, bei der einige Memory Leaks gefixt wurden. Wobei ich mit Debian Bordmitteln nur auf 5.2.14 komme, leider nicht auf 5.3.3

Meine Werte sehen jetzt jedenfalls so aus.


<IfModule mpm_prefork_module>
StartServers 10
MinSpareServers 20
MaxSpareServers 40
MaxClients 50
MaxRequestsPerChild 1
</IfModule>


Wie dem auch sei, vielen Dank für eure Hilfe.

marce
13.10.10, 19:10
MinSpareServers von 10 finde ich recht hoch für das von Dir genannte Szenario.

Ein Memory-Leak muss nicht von php selbst kommen, das kann auch die php-Anwendung sein.

Hast Du schon mal probiert, Keep-Alive abzuschalten?

Zoba
13.10.10, 22:01
MinSpareServers von 10 finde ich recht hoch für das von Dir genannte Szenario.

Naja, wenn ein Abruf vom Client kommt, werden gleich 9 (oder waren es 12? muss mal schauen) Verbindungen gleichzeitig aufgebaut. Daher dachte ich, es wäre vielleicht gut, wenn dann auch genug Prozesse in der Warteschleife stehen. Vor allem, weil meine bestehenden Prozesse nach der ersten Verbindung gleich wieder gekillt werden.



Ein Memory-Leak muss nicht von php selbst kommen, das kann auch die php-Anwendung sein.

Ok, danke für die Info.



Hast Du schon mal probiert, Keep-Alive abzuschalten?
Ich wollte meine Einstellungen mal produktiv testen. Ging super. Statt 4 GB, ging Apache auf etwa 250MB. Also kann ich das evtl wieder etwas entschärfen, weiß aber, wo ich dran drehen muss. Keep Alive probiere ich dann morgen mal.

Zoba
14.10.10, 20:34
KeepAlive Off bringt bei mir nichts. Ich habe das mal versucht und gleichzeitig MaxRequestsPerChild auf 100 gesetzt. Die Apache Prozesse werden wieder dick und rund. Ich habe es diesmal nicht auf die Spitze getrieben, aber selbst 20min nach dem letzen Abruf sieht top noch so aus


top - 21:28:29 up 9:43, 1 user, load average: 0.00, 0.00, 0.04
Tasks: 104 total, 3 running, 101 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.2%us, 0.2%sy, 0.0%ni, 99.5%id, 0.0%wa, 0.2%hi, 0.0%si, 0.0%st
Mem: 1027956k total, 1001492k used, 26464k free, 4552k buffers
Swap: 3004112k total, 652736k used, 2351376k free, 56524k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
14431 www-data 20 0 409m 65m 3772 S 0 6.5 0:05.10 apache2
14447 www-data 20 0 407m 64m 3896 S 0 6.4 0:04.88 apache2
14423 www-data 20 0 407m 64m 3908 S 0 6.4 0:04.82 apache2
14430 www-data 20 0 409m 63m 3868 S 0 6.4 0:05.10 apache2
14437 www-data 20 0 409m 63m 3908 S 0 6.3 0:05.00 apache2
14424 www-data 20 0 405m 62m 3880 S 0 6.3 0:04.74 apache2
14428 www-data 20 0 398m 62m 3868 S 0 6.3 0:04.52 apache2
14422 www-data 20 0 407m 62m 3896 S 0 6.3 0:05.08 apache2
14446 www-data 20 0 405m 62m 3908 S 0 6.2 0:04.62 apache2
14445 www-data 20 0 402m 61m 3896 S 0 6.2 0:04.70 apache2
14425 www-data 20 0 411m 61m 3892 S 0 6.1 0:05.44 apache2
14427 www-data 20 0 405m 58m 3868 S 0 5.8 0:04.76 apache2
14429 www-data 20 0 400m 54m 3868 S 0 5.4 0:04.64 apache2
14426 www-data 20 0 398m 54m 3876 S 0 5.4 0:04.42 apache2
15927 www-data 20 0 342m 48m 11m S 0 4.8 0:01.74 apache2


Daraus folgt für mich, dass ich MaxRequestsPerChild auf 1 lassen sollte und MinSpareServers so hoch setzen sollte, dass genug Prozesse bereits stehen, um die eingehenden Anfragen zu bearbeiten.


Vielen Dank für die Hilfe