httpd freezes my server

Discussion in 'Server Operation' started by K_meleonu, Oct 19, 2013.

  1. K_meleonu

    K_meleonu Member

    Hello to all,
    I have a server with Fedora 13. It is working great excepting once - two times a month it block's.
    The problem i have found is apache. It increases my server load up to 180 or more.
    I can login to server via ssh verry hard and killall -9 httpd. After i kill httpd the load decreases and untill next freez it don't go higher than 1,5
    I cannot see where is the problem and why apache makes my server freez.
    I have even triyed to run a bash script under cron to killall my apache processes and restart apache after 1 minute if the server load is higher than 20 but it seems it does not work under cron.

    The bash script is:
    Code:
    #!/bin/bash
    load=`cut -d . -f 1 /proc/loadavg`;
    if [ "$load" > "20" ];
    then
    echo `date`" - Load-ul este - $load " >> /home/load.txt;
    else
    killall -9 httpd;
    sleep 60;
    killall -9 httpd;
    sleep 60;
    service httpd restart;
    sleep 30;
    /usr/bin/curl --silent http://crazydesign.biz/sms/load.php;
    fi
    
    It check's if the load is below or under 20. If it is higher than 20 it should kill all httpd processes, sleep 60 secs., kill them again (in the case one ore more processes remain started), sleeps again 60 secs, restarts the httpd / apache server and gets an url wich send's me a SMS message to let me know that the load was ower 20 and the apache server was restarted.

    As i was telling above, the script work's if i run it myself but under cron it does NOT work.

    Has anyone any ideeas regarding this apache problems?

    If you need more details please let me know and i will give you all the infos.

    Thank you all in advance.
     
  2. galius

    galius New Member

    Hello,


    I have the same problem with my Debian 7. When traffic increases, my server crashes, can not connect via ssh or any other means.
     
  3. edge

    edge Active Member Moderator

    Not sure what could cause the high load on your server.

    Sometimes I have this problem with one of my servers running the "convert" command when it hangs.

    I use the following script to kill the "convert"
    http://bash.cyberciti.biz/monitoring/monitor-unix-linux-system-load/

    At the # if so send an email code part I have added a line: pkill convert

    In your case it should be pkill httpd and than a next line to start httpd again.


    Good luck.
     
  4. galius

    galius New Member

    Thank you for your reply.
    How to install this script and put it in operation? Can you tell me the steps or else do you have a tutorial?

    You have this problem with Debian 7 systems?
    I know he has a problem identified in:
    Debian Wheezy
    Ubuntu 12.04
    Ubuntu 13.04

    for servers with:

    VIA ® Nano ® U2250 (my current server)
    ( http://www.coreboot.org/pipermail/coreboot/2012-July/071078.html )

    Thank you ;)
     

Share This Page