Results 1 to 14 of 14
  1. #1
    Join Date
    Feb 2004
    Posts
    51

    Restart apache at high load

    Hello,

    Could anyone help me write a cronjob so that apache will restart when the server reaches a load of 20.

    Thank you in advance.

    cem

  2. #2
    Join Date
    May 2006
    Posts
    556
    What about just fixing apache? I could help with that.

  3. #3
    Quote Originally Posted by IceCreamMan
    What about just fixing apache? I could help with that.
    well, I think my issue related to your help;
    Server load reach to 216 suddnly, then I call DC to restart server and check
    hardware, They reply "Hardware is OK and hasn't any problem"
    I check apache and Install apf firewall but still problem happened.
    May help me in this issue please ?
    Best Regards;
    Ali Hamed
    Linux Administrator

    www.linuxman.host.sk

  4. #4
    Join Date
    May 2006
    Posts
    556
    Do you get a lot of traffic? Is most of the traffic legit? You might need to setup some dos protection. Software protection or hardware might even be needed.

  5. #5
    Do you get a lot of traffic?
    I created a small script to catch server status and It's a cut of log file
    Code:
    server time now is 29-12-06-11:53:38 AM
    --------------------------------
    11:53:39 up 2 days, 23:43,  0 users,  load average: 211.13, 150.85, 78.20
    /////////////////////////////
    Uptime: 110588  Threads: 501  Questions: 7390479  Slow queries: 5160  Opens: 184706  Flush tables: 1  Open tables: 512  Queries per second avg: 66.829
    /////////////////////////////
    Current HTTP request:  258
    Is most of the traffic legit?
    I Don't know how to confirm it.
    You might need to setup some dos protection. Software protection or hardware might even be needed.
    I installed mod_evasive for few days then uninstall it because it depended on IP and as u know most people from Arabic Gulf area connecting to Internet using same IP
    Best Regards;
    Ali Hamed
    Linux Administrator

    www.linuxman.host.sk

  6. #6
    Join Date
    Jan 2005
    Location
    San Francisco/Hot Springs
    Posts
    988
    I would suggest looking through the web logs to see what people are doing.

    Your server going to a load of 200something is probably not a good sign.
    AppliedOperations - Premium Service
    Bandwidth | Colocation | Hosting | Managed Services | Consulting
    www.appliedops.net

  7. #7
    I would suggest looking through the web logs
    I browsed access_log and error_log many time but couldn't find any up normal actions.
    May u explain what u mean, please?
    Best Regards;
    Ali Hamed
    Linux Administrator

    www.linuxman.host.sk

  8. #8
    Join Date
    Jan 2005
    Location
    San Francisco/Hot Springs
    Posts
    988
    Have you run them through a log analysis tool or anything like that? It might help you figure out whats making your load go through the roof.

    If that doesn't result with anything useful, maybe consult a professional.
    AppliedOperations - Premium Service
    Bandwidth | Colocation | Hosting | Managed Services | Consulting
    www.appliedops.net

  9. #9
    Have you run them through a log analysis tool or anything like that?
    i'm using vi , may u recommend analysis tool ?
    Best Regards;
    Ali Hamed
    Linux Administrator

    www.linuxman.host.sk

  10. #10
    Join Date
    Jan 2005
    Location
    San Francisco/Hot Springs
    Posts
    988
    Try webalizer or awstats or pwebstats
    AppliedOperations - Premium Service
    Bandwidth | Colocation | Hosting | Managed Services | Consulting
    www.appliedops.net

  11. #11
    Man, weblizer for get website status it doesn't get me any technical information
    Best Regards;
    Ali Hamed
    Linux Administrator

    www.linuxman.host.sk

  12. #12
    Join Date
    Sep 2000
    Location
    Alberta, Canada
    Posts
    3,109
    Quote Originally Posted by cem
    Hello,

    Could anyone help me write a cronjob so that apache will restart when the server reaches a load of 20.

    Thank you in advance.

    cem
    Would be easier to fix the problem.

    - is Apache optimized
    - is mod_security installed, other Server hardening should be done as well
    - has the Server been hacked
    - is the Server overloaded

    The above is a quick list of what is usually the problem with Servers and high loads.
    PotentProducts.com - for all your Hosting needs
    Helping people Host, Create and Maintain their Web Site
    ServerAdmin Services also available

  13. #13
    Join Date
    Oct 2005
    Posts
    435
    I'm sure its caused by a bad script on your server.

    I'm still having the same issue.. although not as bad now.

    I installed some forum modifications that makes the server have extremely high load randomly.

    Check up on that if you can.

    I'm not sure about restarting apache on 20 load.. but I put in a cron job for apache to restart every 5 mins.. that at least kept the server up and not die and requiring a reboot.

    Might want to do that while you find the solution to the problem.

  14. #14
    Join Date
    Apr 2005
    Location
    Cochin
    Posts
    2,446
    also check for DOs attack to port 80

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •