apache processes taking 100% of CPU

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

enter image description 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 ?

Answer

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.

Attribution
Source : Link , Question Author : Taha , Answer Author : iprok

Leave a Comment