Activity Stream
48,167 MEMBERS
6946 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1.     
    #1
    Member
    Website's:
    StudentSharez.com

    Default 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
    DoctorX 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: 5
    Offshore-host.blogspot.com - List of DMCA flexible webhosts.
    StudentSharez.com - Medical ebooks and lectures.

  2.   Sponsored Links

  3.     
    #2
    Banned
    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

  4.     
    #3
    Member
    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

  5.     
    #4
    Member
    Website'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.

  6.     
    #5
    Member
    Website's:
    Elite.SO Defendos.com Motionite.com
    You 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
    But trust me, this won't help reducing the server load.

    Defendos BETA3 Released! Thread - Official Website

  7.     
    #6
    Member
    Website's:
    StudentSharez.com
    Hello, Thank you localhost.
    I have created this file /etc/cron.hourly/automatic.sh with this code:
    /etc/init.d/apache2 restart
    service mysql restart
    is there a way to know that this file is working correctly?
    Offshore-host.blogspot.com - List of DMCA flexible webhosts.
    StudentSharez.com - Medical ebooks and lectures.

  8.     
    #7
    Member
    Run it manually and you will see the output

    /bin/sh /etc/cron.hourly/automatic.sh
    You can also add these restart commands in the script given above.
    Linux System Administrator
    Server Management at affordable cost.
    linuxhostingsupport.net | MSN:madaboutlinux@hotmail.com

  9.     
    #8
    Member
    Website's:
    StudentSharez.com
    madaboutlinux, 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 32127
    Offshore-host.blogspot.com - List of DMCA flexible webhosts.
    StudentSharez.com - Medical ebooks and lectures.

  10.     
    #9
    Member
    Website's:
    newrapidleech.com blog.newrapidleech.com
    to 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.

  11.     
    #10
    Member
    ^ totally agree with Not_Responding. Especially if your using Kloxo - takes too much ram

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Automatically restart Apache & MySQL
    By Sp32 in forum Webmaster Resources
    Replies: 1
    Last Post: 5th Sep 2011, 12:20 PM
  2. Help installing php with xmlrpc.mysql,apache
    By lukip006 in forum Technical Help Desk Support
    Replies: 8
    Last Post: 20th Mar 2011, 04:34 AM
  3. Using SSH, Apache, MySQL without Control Panel? How?
    By Sponge Bob in forum Web Application/Script Support
    Replies: 15
    Last Post: 8th Jan 2011, 04:11 AM
  4. Optimizing MySQL and Apache - Help
    By optimushunk in forum Server Management
    Replies: 25
    Last Post: 16th May 2010, 07:24 PM
  5. Automatic MySQL Backup Script
    By Lease in forum Technical and Security Tutorials
    Replies: 0
    Last Post: 9th Jan 2008, 01:57 AM

Tags for this Thread

BE SOCIAL