Why Apache needs so much children when almost there is no connections?
I’m using 1-click app Ubintu+Wordpress for a small blog on minimal configuration (with 512 MB of RAM).
New, small blog, just 1 page and 2 posts. Maximum pageviews per day - 156 (2 days ago).
Yesterday I’ve experienced a problem with RAM (details are here: https://www.digitalocean.com/community/questions/mysql-keeps-crashing-kill-process-919-mysqld-score-86-or-sacrifice-child). I’ve created a 1GB swap but it didn’t help (mysql crushed anyway at some point).
Blog was just started. There is no much visitors for the moment. I believe, I was the only visitor yesterday and today. So I though it shouldn’t be normal that 512 MB of RAM is not enough.
I found a tutorial for Apache optimization: https://www.digitalocean.com/community/tutorials/how-to-optimize-apache-web-server-performance
For example, it suggests to decrease number of children by changing parameter MaxClients in apache2.conf (for mpmpreforkmodule). Actually, in my case it’s a parameter MaxRequestWorkers in mpm_prefork.conf.
Initially I changed it to 15 as it was suggested in tutorial (default setting was 150). But Apached stopped to work just after a restart. There was an error in Apache log: “server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting”.
Then I set MaxRequestWorkers to 100. But again Apache stopped to work, but in this case a little later than previously.
So service doesn’t work because of lack of memory of because of too small MaxRequestWorkers value. But if I increase MaxRequestWorkers it will eat all memory again.
What am I doing wrong? Should I be an experienced Linux user to use 1-click app Wordpress? Should I know how to fine tune Apache and MySQL.
(I don’t believe 512 GB is not enough for a blog with a small number of visitors)
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×