Vanilla 1.1.8 is a product of Lussumo. More Information: Documentation, Community Support.
1 to 18 of 18
I have a Django Python 256 Slice that has a Nginx front end which serves up static media files, passes Django/Python requests back to an Apache 2.2 prefork MPM server utilizing mod_wsgi. I have two small, low-traffic sites on the slice.
Yesterday I had to restart the slice because the swap was being eaten up. Page load times were 10 seconds plus. Today the memory usage already seams to be spirling out of control. Here are some images of memory usage:


Apache seams to be eating memory like there's no tomorrow. Does anyone have any suggestions to help keep Apache memory usage down?
Here's my apache Config:
Timeout 300
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 15
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 0
</IfModule>
Edit: changed category.
I know they swap's not being used right now. I said they it was being used yesterday, before I restarted the server.
Currently Apache is using 60%+ memory for two sites that are lucky to get more then 1500 hits a month combind.
How can I make the swap from mpm-prefork to mpm-worker?
I'm getting an error with that install command:
The following NEW packages will be installed:
apache2-mpm-worker
The following packages will be REMOVED:
apache2-mpm-prefork
0 packages upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
Need to get 251kB of archives. After unpacking 8192B will be used.
Do you want to continue? [Y/n/?] Y
Writing extended state information... Done
Err http://archive.ubuntu.com hardy-updates/main apache2-mpm-worker 2.2.8-1ubuntu0.3
404 Not Found [IP: 91.189.88.46 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/a/apache2/apache2-mpm-worker_2.2.8-1ubuntu0.3_amd64.deb: 404 Not Found [IP: 91.189.88.46 80]
E: Unable to correct for unavailable packages
This worked:
sudo dpkg --purge -a
sudo apt-get update
The install worked. I'm up and running with mpm-worker now.
Since I'm not very familiar with with mpm-worker, at all, is the defaut configuration overkill for a small server? Does anyone have a recommended "sweet spot"?
<IfModule mpm_worker_module>
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>
Memory usage is way down and the sites are preforming noticabley faster. They seam to have hickups every 5th page load or so, taking 3-5 seconds to load. The normal page load it hovering around 250ms now, so that's nice.
Can the swap from prefork to worker be done on a server using PHP as well? Or a server using any scripting language? If prefork is that much of a memory hog then why is it the default to begin with?
I ask because I have a LAMP slice that I know notice is using swap.


Here's the configuration for that server:
Timeout 30
KeepAlive On
MaxKeepAliveRequests 200
KeepAliveTimeout 2
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 175
MaxRequestsPerChild 0
</IfModule>
Thoughts?
Very low. I'll cut it down to 100.
Considered and implemented. Thank you. I'll monitor it over the next while and adjust accordingly.
Thanks again for your time!
Excellent. It's one thing to read the manual about how these work, and another to have it explained in plain English.
It's a really low traffic server, so I'll set MaxRequestsPerChild to 500 for now.
Thanks!
1 to 18 of 18