MaxClients too high? (Apache 2)

jjma

Verified User
Joined
Mar 29, 2004
Messages
275
Location
Edinburgh,Scotland
Been having issues with our server falling over with memory being exhausted around 10 -12pm (at night). Havn't completely figured out why, checked /var/log/messages and dmesg but see apache and exim processes spiking. This might be because of the lack of memory - not sure..

Looked at my httpd-mpm.conf and thought that the MaxClients was possibly too high for the server:

<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
ServerLimit 450
MaxClients 450
MaxRequestsPerChild 0
</IfModule>

Our server runs on 2gb of ram. Any thoughts?

regards,

Jon
 
Turn on apache extended status and see what sites are being used. 450 is nothing at all.

Install htop and you can see your memory usage of your server in real time.

If you are running low on memory though you should see your swap usage get very high and possibly errors in dmesg or /var/log/messages.
 
Will try that, thanks.

Tried to set the directadmin cronjob an hour ago and managed to bring the server down with these errors in the /var/log/messages

Apr 3 12:35:16 sp2 clamd[7973]: SelfCheck: Database status OK.
Apr 3 12:41:25 sp2 kernel: INFO: task mysqld:15345 blocked for more than 120 seconds.
Apr 3 12:41:25 sp2 kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
Apr 3 12:41:25 sp2 kernel: mysqld D 00000CEB 2524 15345 32083 15346 15167 (NOTLB)
Apr 3 12:41:25 sp2 kernel: c50c7f54 00000082 bf379c08 00000ceb ca9b1648 f43c6c5c 00000000 00000001
Apr 3 12:41:25 sp2 kernel: d9d18000 bf384f01 00000ceb 0000b2f9 00000001 d9d1810c c2013ac4 edc5de40
Apr 3 12:41:25 sp2 kernel: 08515c98 c6cb37b8 c2014464 c200cc80 00000020 00000000 00000000 00000000
Apr 3 12:41:25 sp2 kernel: Call Trace:
Apr 3 12:41:25 sp2 kernel: [<c0622f16>] rwsem_down_write_failed+0x126/0x141
Apr 3 12:41:25 sp2 kernel: [<c0439989>] .text.lock.rwsem+0x2b/0x3a
Apr 3 12:41:25 sp2 kernel: [<c046aa6a>] sys_mprotect+0xbd/0x1eb
Apr 3 12:41:25 sp2 kernel: [<c0404f4b>] syscall_call+0x7/0xb
Apr 3 12:41:25 sp2 kernel: =======================
Apr 3 12:41:25 sp2 kernel: INFO: task clamd:15721 blocked for more than 120 seconds.
Apr 3 12:41:26 sp2 kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
Apr 3 12:41:26 sp2 kernel: clamd D 00000D49 2528 15721 1 16416 15449 (NOTLB)
Apr 3 12:41:26 sp2 kernel: e848cf74 00000086 8f107b57 00000d49 30ea2005 e848cf44 c08259d0 00000007
Apr 3 12:41:26 sp2 kernel: e8c6aaa0 8f117848 00000d49 0000fcf1 00000000 e8c6abac c200cc80 f4f5f3c0
Apr 3 12:41:26 sp2 kernel: c041f863 00000184 c200d620 c2013ac4 00000020 00000000 d887f0a8 f766f0c0
Apr 3 12:41:26 sp2 kernel: Call Trace:
Apr 3 12:41:26 sp2 kernel: [<c041f863>] default_wake_function+0x0/0xc
Apr 3 12:41:26 sp2 kernel: [<c048e994>] destroy_inode+0x38/0x47
Apr 3 12:41:26 sp2 kernel: [<c0622f16>] rwsem_down_write_failed+0x126/0x141
Apr 3 12:41:26 sp2 kernel: [<c0439989>] .text.lock.rwsem+0x2b/0x3a
Apr 3 12:41:26 sp2 kernel: [<c046a32b>] sys_munmap+0x24/0x41
Apr 3 12:41:26 sp2 kernel: [<c0404f4b>] syscall_call+0x7/0xb
Apr 3 12:41:26 sp2 kernel: =======================

Jon
 
Hello,

With the error, I'd recommend checking of your hardware. Check HDDs, it's probaly the simplest you can do now, I guess, smartmontools might be useful here. But in my experience, SMART not always can find a problem; I mean sometimes HDDs with perfect sectors (without bad blocks) can cause such an error.
 
Yeah it has to be a form of bad hardware somewhere if you are getting segfaults on multiple programs. I would check hard drives or ram. Ask your hosting provider for help if you are renting a dedicated server.
 
Back
Top