We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
How to automatically restart httpd when overloaded
How to automatically restart httpd when overloaded
Hello friends.
Service httpd on vps always overload, memory up to 1GB or more. It makes mysqld stop times lead to faulty
I'm using vestacp, please help me create a cron job to automatically check httpd if overloaded, it will automatically restart and thus mysqld
It as a cron job created automatically
This is my site https://sharelachuan.com
Regrads.
Duy Toi
Service httpd on vps always overload, memory up to 1GB or more. It makes mysqld stop times lead to faulty
I'm using vestacp, please help me create a cron job to automatically check httpd if overloaded, it will automatically restart and thus mysqld
It as a cron job created automatically
This is my site https://sharelachuan.com
Regrads.
Duy Toi
Re: How to automatically restart httpd when overloaded
Usually once httpd is stopped, the load drops down within 60/100 seconds so there is hardly anytime down time, but it does give you time to investigate where the issue is, especially if it happens all the time.
To install, run the following in ssh and this will pull the file from my server over to yours.
Then you need to add the cron to the cron tab so that it checks your server every 60 seconds.
Follow these instructions to edit the root cron file
1. open the cron file
2. add the following line to the cron file so it runs every minute
3. restart the cron with this command
Thats it!
The only thing you need to do now is change a couple of settings within the file to set your email address.
Do the following to edit your settings.
This will open the file and then you only need to edit the following settings:
my $contacts – the email address to send alerts to
my $from_address – the custom name of the server so you know which server its coming from
To install, run the following in ssh and this will pull the file from my server over to yours.
Code: Select all
cd
wget http://www.craig-edmonds.com/special-tools/loadmonitor.txt
mv /root/loadmonitor.txt /root/hsws-loadmonitor.pl
chmod 755 /root/hsws-loadmonitor.pl
Follow these instructions to edit the root cron file
1. open the cron file
Code: Select all
pico /var/spool/cron/root
Code: Select all
* * * * * /root/hsws-loadmonitor.pl > /dev/null 2>&1
Code: Select all
/etc/init.d/crond restart
The only thing you need to do now is change a couple of settings within the file to set your email address.
Do the following to edit your settings.
Code: Select all
pico /root/hsws-loadmonitor.pl
my $contacts – the email address to send alerts to
my $from_address – the custom name of the server so you know which server its coming from
-
- Support team
- Posts: 1096
- Joined: Sat Sep 06, 2014 9:58 pm
- Contact:
- Os: Debian 8x
- Web: apache + nginx
Re: How to automatically restart httpd when overloaded
I'm 200% sure your server is compromised, some site may be injected with malicious code.
or
your App is leaking memory and causing high load.
You should really try to find out the problem rather than restarting httpd automatically.
or
your App is leaking memory and causing high load.
You should really try to find out the problem rather than restarting httpd automatically.
Re: How to automatically restart httpd when overloaded
Thank mehargags and EliZine helped me.
I will follow up more time to figure out the cause of this situation on my server
Regards !
Duy Toi
I will follow up more time to figure out the cause of this situation on my server
Regards !
Duy Toi