virtual server oomguarpages privvmpages resource errors
running lamp ubuntu7.10 apache2 mysql php subversion trac wiki on parallels virtuozzo plesk
Problem - even though there's enough RAM, apache2's confgiuration wants to have thread/processes that over tax the virtual server...
so we'll try some tricks:
- remove extra modules /etc/apache2/httpd.conf
Do you need CGI, Perl,
That will save you some ram, but the BIGGEST impact is in how Apache handles multiple requests.
Find the section that has all the LoadModule lines. Then, examine each line that starts with LoadModule. If it's extra, just place a # symbol at the front of the line to comment it out.
You'll then want to comment out the corresponding AddModule a little further down in the config file.
/etc/apache2/apache2.conf to look like this:
...
Default is 2
StartServers 1
Default is 150
MaxClients 80
Default is 25
MinSpareThreads 5 MaxSpareThreads 75
Default is 25
ThreadsPerChild 5 MaxRequestsPerChild 0
StartServers 1 MinSpareServers 1 MaxSpareServers 5 MaxClients 5 MaxRequestsPerChild 300
I have found that turning it down to 2 seconds seems to give the client enough time to request all of the files needed for a page without having to open multiple connections, yet allows Apache to terminate the connection soon enough to be able to handle many more clients than usual.
Lower your Timeout variable (do you want to wait 300 seconds?)
Log Less (set it to critical, everything more important than critical will still be logged).
/usr/sbin/apache2 -l //shows what compiled modules
You can't remove prefork.c or worker.c, they're compiled in... apt-get install apache2-mpm-prefork //non threaded apt-get install libapache2-mod-php5 //prefork MPM