One of my Linux web servers recently ran out of memory, hung itself in an OOM kill frenzy, and had to be rebooted. This is a 512 MB VPS, but it has been running without problems since it was set up months ago. How can I prevent this from happening again?
I have not been able to find out from the logs which process was the cause. The processes killed were mysqld followed by apache2. Based on what's running on the box, I think it's likely that something went wrong in one of the Django applications (running under apache and mod_wsgi). Would limit the stack size (with the stack-size
option to wsgi) help? Is is possible to limit wsgi or python or apache's memory usage in general? (The answers to this question say no.)