If I'm at the wrong place to ask this kind of question, please point me to the right direction, i'd appreciate very much!
I'm hosting a Drupal website on a VPS. Here are the specs:
The VPS commercial denomination is E3-SSD-2-32 - E3-1225v2 - 32GB - SoftRaid 3x120GB SSD. I'm not an expert but this is what I get: 32GB of RAM is a lot. And the hard drive is SSD which is supposed to mean fast read and writes. Also I think it has 3 CPU cores, but like I said I'm shit in hardware...
According to Google Analytics:The website has about 50,000 daily users and between 300 and 500 users are browsing at any given time.
At some times of the day (around lunch time), the server response time is insanely slow (up to 20 seconds to show a page), and sometimes, the connection just times out and chrome shows the grey error page.
What I've looked into
-> Apache2 MaxRequestWorkers
I've used Apache2Buddy to help me tune Apache2 MaxRequestWorkers.
Here's the complete Apache2Buddy output: https://pastebin.com/PQKrrcCz
Here's my current /etc/apache2/mods-enabled/mpm_prefork.conf:
<IfModule mpm_prefork_module> StartServers 5 MinSpareServers 5 MaxSpareServers 10 ServerLimit 1300 MaxRequestWorkers 1300 MaxClients 1300 MaxConnectionsPerChild 0 </IfModule>
I've also enabled caching in Drupal to reduce Mysql load.
Here's the output of htop taken when the website was being slow: https://imgur.com/a/gObNfyP
According to htop, the memory usage is 2.75GB, and the CPUs are only at 4% usage.
What I don't get is that Apache2Buddy is telling me that Apache is using about 9GB of RAM while htop says total RAM usage is 2.75GB.
The only clue I have...
When I restart apache with
apachectl restart the website starts to work normally again... only until the next crisis...
Seriously I'm starting to lose hope here so any help would be very much appreciated.....