Server Keeps Going Under — Incredible # of Connections
Posted: Sun Feb 21, 2016 6:27 pm
I have been troubleshooting this problem for months now. For whatever reason, my web server keeps going down.
Randomly, a couple times a week, the server gets overloaded, all the memory becomes consumed, and the sites become inaccessible. I will also get e-mails from VestaCP telling me that the files cannot backed up.
I have tried enabling mod_status, I have tried optimizing Apache2 and MySQL, and I have implemented Cloudflare in case it was a DDOS.
Take a look at the graphs. The numbers are ridiculous:
Right where you see the first peak is where the server goes down.
How could that many SQL queries even be executed?
How can I trace this and find out where the problem is? Is it a memory leak? Is it an injection? What's going on! For months I've been dealing with this.
Restarting Apache and clearing the memory brings everything back online, but it just happens again.
Here's the Apache config:
Randomly, a couple times a week, the server gets overloaded, all the memory becomes consumed, and the sites become inaccessible. I will also get e-mails from VestaCP telling me that the files cannot backed up.
I have tried enabling mod_status, I have tried optimizing Apache2 and MySQL, and I have implemented Cloudflare in case it was a DDOS.
Take a look at the graphs. The numbers are ridiculous:
Right where you see the first peak is where the server goes down.
How could that many SQL queries even be executed?
How can I trace this and find out where the problem is? Is it a memory leak? Is it an injection? What's going on! For months I've been dealing with this.
Restarting Apache and clearing the memory brings everything back online, but it just happens again.
Here's the Apache config:
Code: Select all
PidFile ${APACHE_PID_FILE}
Timeout 30
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 1
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 1
MaxSpareServers 5
ServerLimit 10
MaxRequestsWorkers 10
MaxClients 10
MaxRequestsPerChild 100
</IfModule>