IO/Swap Spikes, causing server issues.
~~![](<URL url=)http://i.imgur.com/keZkPXN.jpg
Being new to the server game I'm almost positive I shouldn't be seeing this much swap happen. (But maybe I should?) Usually when I get a spike I get a error from wordpress establishing a database connection (not sure if that would be a clue or not?).
Any help is much appreciated!~~
7 Replies
<ifmodule mpm_prefork_module="">StartServers 2
MinSpareServers 6
MaxSpareServers 12
MaxClients 40
MaxRequestsPerChild 3000</ifmodule>
I had it set to 40 on a 1024 Linode, guess that would be to much? From what I just read through it's seems 50 and below *should be ok?
MySQL:
max_connections = 75
key_buffer = 32M
max_allowed_packet = 1M
thread_stack = 128K
table_cache = 64
PHP:
max_execution_time = 30
memory_limit = 256M
error_reporting = E_ALL & ~E_DEPRECATED
display_errors = Off
log_errors = On
;error_log = php_errors.log
register_globals = Off
I'm particularly interested in the recommendation to back off from 40 clients with prefork to 10 to 15, as I've got mine set at 80, which was the linode how-to's recommendation for a 2048 (i.e. doubling the 1024's 40). So I'm wondering if you tried that, and if that helped.
Thanks!
I would say the Linode Guide is wrong. Maybe they meant 8 or something, not 80.
You'd be better of with nginx, especially if you need 80 clients.
From the comments in this thread, I scaled back maxclients from 80 to 40.
I ran the "apachememoryusage.sh" script before and after the change to see how Apache's memory utilization looked with both settings. With maxclients at 80, Apache memory usage was 740MB (under light loading) and average process size was 56MB. Then, with maxclients at 40, and after half a day running that way, Apache memory usage was at 833MB (under moderate loading) and average process size was 64MB. After several weeks with the reduced maxclients setting, my site's OOM problems appeared to have gone away.
That was on a 2GB Linode that had 2GB RAM plus 8 shared CPU cores. Last week, the Linode dashboard informed me that those 2GB Linodes were getting migrated to a new 4GB configuration that had 4 shared CPU cores, and I upgraded my site to the new Linode style with 4GB RAM. I suspect this larger RAM allocation will make the 40 maxclients setting even safer, but will report back if any more OOM problems arise.