Question

MaxClients Ubuntu stops responding

Posted August 7, 2013 4k views
Hello, I'm running a site on 512MB 20GB 1TB Ubuntu LAMP droplet. Its average 25-60 concurrent visitors all day. It's working normally some time 4 -5 h then in moment no free memory, apache stop responding and site is off. I set swap file 1GB and swappiness=10 and when its working normally with free -m I see that there is about 160MB physical memory free and whole swap file. I think that problem is with MaxClients in apache2.conf , and I'm not sure what values to set. I see that max value is 256 for this server. What will be the optimal settings?

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.

4 answers
also I tested with blitz.io 50 users memory is full, swap almost and after the test done, memory is not freeing
Why not use Nginx, instead? It's not a memory hog, like Apache.
I'm beginner in all this.
I experimented put down MaxKeepAliveRequests to 90
Keep Alive Timeout to 4
I put down MaxClients to 50 and
upper MaxRequestsPerChild to 150 and for now working

@Pablo Would I get a better performance with Nginx (speed,..)
And whats the procedure to change apache with Nginx?
Thanks in advance
See this thread: https://www.digitalocean.com/community/questions/what-is-nginx-and-why-might-i-want-to-use-it-over-apache
Submit an Answer