I have a VPS with 768 MB RAM and a 1.13 GHZ processor. I run a php/mysql dating site and the performance is excellent and server load is generally very low.
Sometimes I place ads on Facebook and at peak times I can get 100-150 clicks within a few seconds – this causes the server to run out of memory :
Cannot allocate memory: couldn't create child process: /opt/suphp/sbin/suphp ….
And all users receive an error 500 page.
I am just wondering if this sounds reasonable or not – to me 100-150 does not seem to be a number that should cause apache to run out of memory.
Any advice/recommendations how to diagnose the issue highly appreciated.
Best Answer
Optimizing memory footprint is usually done by reducing (and limiting) these factors:
If the load is getting really heavy, you should also look into the speed of request handling (faster loading improve the total size*time of memory needed for one request)
Maybe, if your web isn't any CPU-intensive at all, and you need some extreme Req/S, try some different webserver (like nginx, or lighttpd) which behave better in such situations.