Results 1 to 10 of 11
-
8th Jul 2011, 11:48 AM #1OPMemberWebsite's:
StudentSharez.comAutomatic reboot Apache and Mysql every x min, possible?
Hello,
Is it possible to automatic restart Apache and Mysql every x min to prevent server overload?
ThanksDoctorX Reviewed by DoctorX on . Automatic reboot Apache and Mysql every x min, possible? Hello, Is it possible to automatic restart Apache and Mysql every x min to prevent server overload? Thanks Rating: 5Offshore-host.blogspot.com - List of DMCA flexible webhosts.
StudentSharez.com - Medical ebooks and lectures.
-
8th Jul 2011, 12:42 PM #2Banned
i dont think you can but not fully sure but then your site would be down for a few sec if you kept doing that
-
8th Jul 2011, 12:48 PM #3Member
It is, using simple commands but sometimes it will kill the connections from clients even if the load is normal and if the time difference between the restarts is high, the server may become non-responsive and the restart command won't work.
The better idea is to trace out the exact problem and eradicate it.
If you think there isn't a problem and legitimate traffic increases the load, you should look to upgrade your server.
If you don't want to upgrade the server, write a script in a way which will monitor the load average every minute and will restart the services if load average reaches a certain limit stated in the script.
Here is a shell script to monitor load average on linux server but you need to add a code in it to restart the apache/mysql services.Linux System Administrator
Server Management at affordable cost.
linuxhostingsupport.net | MSN:madaboutlinux@hotmail.com
-
8th Jul 2011, 01:19 PM #4OPMemberWebsite's:
StudentSharez.com@accyuklad: yes, but just 2-5 seconds, not more.
@madaboutlinux: thank you mate for the info.yes, i will upgrade the server soon.
i will try to use that script for now and monitor the result.Offshore-host.blogspot.com - List of DMCA flexible webhosts.
StudentSharez.com - Medical ebooks and lectures.
-
8th Jul 2011, 01:31 PM #5MemberWebsite's:
Elite.SO Defendos.com Motionite.comYou can do it using cron jobs.
Example, restart apache and mysql every hour:
Create a .sh file in this directory: /etc/cron.hourly
with the following code:
Code:service httpd restart service mysqld restart
-
8th Jul 2011, 01:45 PM #6OPMemberWebsite's:
StudentSharez.comHello, Thank you localhost.
I have created this file /etc/cron.hourly/automatic.sh with this code:
/etc/init.d/apache2 restart
service mysql restartOffshore-host.blogspot.com - List of DMCA flexible webhosts.
StudentSharez.com - Medical ebooks and lectures.
-
8th Jul 2011, 01:51 PM #7Member
Run it manually and you will see the output
/bin/sh /etc/cron.hourly/automatic.shLinux System Administrator
Server Management at affordable cost.
linuxhostingsupport.net | MSN:madaboutlinux@hotmail.com
-
8th Jul 2011, 01:57 PM #8OPMemberWebsite's:
StudentSharez.commadaboutlinux, thank you very much.
it works:
root@server:/etc/cron.hourly# /bin/sh /etc/cron.hourly/automatic.sh
* Restarting web server apache2 ... waiting [ OK ]
mysql start/running, process 32127Offshore-host.blogspot.com - List of DMCA flexible webhosts.
StudentSharez.com - Medical ebooks and lectures.
-
8th Jul 2011, 02:44 PM #9MemberWebsite's:
newrapidleech.com blog.newrapidleech.comto reduce server load, it'd be better if you switch from apache to nginx or lighttpd. or maybe reversing nginx as a proxy to apache
restarting it over and over again will not help you much.
-
8th Jul 2011, 03:20 PM #10Member
^ totally agree with Not_Responding. Especially if your using Kloxo - takes too much ram
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Automatically restart Apache & MySQL
By Sp32 in forum Webmaster ResourcesReplies: 1Last Post: 5th Sep 2011, 12:20 PM -
Help installing php with xmlrpc.mysql,apache
By lukip006 in forum Technical Help Desk SupportReplies: 8Last Post: 20th Mar 2011, 04:34 AM -
Using SSH, Apache, MySQL without Control Panel? How?
By Sponge Bob in forum Web Application/Script SupportReplies: 15Last Post: 8th Jan 2011, 04:11 AM -
Optimizing MySQL and Apache - Help
By optimushunk in forum Server ManagementReplies: 25Last Post: 16th May 2010, 07:24 PM -
Automatic MySQL Backup Script
By Lease in forum Technical and Security TutorialsReplies: 0Last Post: 9th Jan 2008, 01:57 AM
themaLeecher - leech and manage...
Version 5.03 released. Open older version (or...