-1

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 ?

Pierre.Vriens
  • 1,159
  • 34
  • 15
  • 19
Taha
  • 3
  • 1
  • 3
  • Do you really need Prefork (process-based) MPM? *Worker* or *Event* (multithreaded) Apache can be way more effective for busy sites, as spawning a thread is cheaper than spawning a process to serve a request. And if you use PHP, avoid the Apache module SAPI if you have a lot of static content and use FastCGI (likely with PHP-FPM SAPI) instead. – sam_pan_mariusz Oct 03 '15 at 16:28
  • Serving static content is not very CPU intensive. Is the site doing anything else? Maybe some code needs to be optimized. You may just need a faster processor. What would be cheaper a faster VM or a whole new VM just for caching? – Ryan Babchishin Oct 03 '15 at 18:03
  • @RyanBabchishin i don't see any other stuff taking a lot of memory – Taha Oct 03 '15 at 18:16
  • varnish is better, are you running wordpress? there are lots of plugins and tuts on how to set it up. – ADM Oct 03 '15 at 19:25
  • guys, are you *really* discussing "how to convert additional memory into CPU power" ? Because I have a strong impression that you do. They are related of course, but not directly, especially within the apache context. – drookie Oct 03 '15 at 21:05

1 Answers1

0

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.

iprok
  • 126
  • 4
  • It seems that I found the issue , with the static content I found a js script from a twitter widget that is making a loop of non ending request I think some optimization with varnish will make the site work like a charm – Taha Oct 04 '15 at 14:36