I'm running 3 separate virtualhosts for my website (Django w/ wsgi for the main site, another Django w/ wsgi for the mobile version of the site, and a 3rd for Wordpress serving as the site's blog). After a few weeks, the swap memory climbs up to the point where my load & ping times become really slow. When I look at
top, I see that there are several Apache processes each taking up a significant amount of memory, and have been running for at least an hour.
This is on an Ubuntu 10.04 server running on Rackspace cloud (medium instance).
I'm running the two django sites with wsgi in daemon mode (threads = 1, processes = 2).
My apache2.conf main settings look like this (with several "irrelevant" things stripped out to minimize the size of this post -- if you're expecting another setting, let me know, and I can check if I have it in there):
Timeout 120 KeepAlive Off MaxKeepAliveRequests 100 KeepAliveTimeout 15 <IfModule mpm_prefork_module> StartServers 5 MinSpareServers 5 MaxSpareServers 10 MaxClients 150 MaxRequestsPerChild 0 </IfModule> <IfModule mpm_worker_module> StartServers 2 MinSpareThreads 25 MaxSpareThreads 75 ThreadLimit 64 ThreadsPerChild 25 MaxClients 150 MaxRequestsPerChild 0 </IfModule> <IfModule mpm_event_module> StartServers 2 MaxClients 150 MinSpareThreads 25 MaxSpareThreads 75 ThreadLimit 64 ThreadsPerChild 25 MaxRequestsPerChild 0 </IfModule>
One thing I've seen suggested is to switch away from Apache to a "less bloated" web server. I'm open to this idea, but am guessing that I would be best moving Wordpress off the server so that I don't need PHP (or do these other web servers offer php and python solutions together?)
Let me know if you want any more information. Thanks!