My VPS get high load quite frequently and the best temporary option is a script that check the load periodically and if the load is bigger than 5 (for example), auto restart the apache server.
I suggest you moving to Nginx, that solved ALL my problems last 2 years. Forget apache, is a history from the dark ages. More and more high volume websites are using nginx because of this reason.
restarting apache is probably the worst scenario you can pick. When apache is started it will get overloaded quickly due to the tons of new requests in short time. Best look how to optimize your site and make the things that cause the load less stressfull. Also consider the possibility to upgrade your VPS with more resources
Is a temporary solution during I re-make the website (this time more optimized).I found this script on internet:#!/bin/shcheck=`uptime | sed 's/\./ /' | awk '{print $10}'`if [ $check -gt 5 ]then/etc/init.d/apache2 restartfiI will love to talk with somebody that know to handle these things before install it on my VPS.Thank you!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.