apache processes taking 100% of CPU – Problems with loading a website are often blamed on the Internet connection, but even the most perfectly set up network cannot help if there is no service to reply at your destination. One of the most popular HTTP servers used for this task is Apache2. Much of Apache’s popularity can be attributed to its easy installation and use, but never the less it is possible to run into problems with even the easiest of the software. If you’ve encountered an issue loading your web page, follow these simple troubleshooting methods outlined in this guide to attempt to get your web server back up and working again. Below are some tips in manage your apache2 server when you find problem about apache-2.2, varnish, debian-lenny, , .
I have a 4 GB virtual server that I’m hosting a rugby website and since it’s a rugby world cup season my site is receiving a good amount of traffic , not too much that it exceeds my server limit because the amount of memory used never been more 1.8 GB and like I said I’ve got a 4GB vps
this is my apache configuration :
maxKeepAliveRequests 10
keepAliveTimeout 5
ServerLimit 550
<IfModule mpm_prefork_module>
StartServers 20
MinSpareServers 20
MaxSpareServers 80
MaxClients 500
MaxRequestsPerChild 2000
</IfModule>
you can see a snapshot of a htop here
There is a lot static content is being used images/css/html,js etc ,
is considering a cache system like varnish , or nginx as a reverse proxy will be a solution for that problem ?
First of all you really need to serve all static content using nginx and use apache on back of it.
Following steps depend on you web application that is served by your webserver. For some caching system like varnish can help, and for some native nginx caching using proxy_cache can be extremely usefull.