Restarting Apache - Dedicated Servers

Discussion in 'Apache' started by EnsureMedia, Feb 11, 2008.

  1. #1
    how often do you restart apache on your dedicated server, if ever?

    I do it about twice per week to keep it clean with requests.....
     
    EnsureMedia, Feb 11, 2008 IP
  2. abdussamad

    abdussamad Active Member

    Messages:
    543
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #2
    Only if I make changes to httpd.conf.
     
    abdussamad, Feb 11, 2008 IP
  3. boltok

    boltok Active Member

    Messages:
    257
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    78
    #3
    I often go months without restarting it.
     
    boltok, Feb 11, 2008 IP
  4. painthappy

    painthappy Peon

    Messages:
    93
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I never restart mine unless I made an httpd.conf change or something similar.

    apachectl graceful

    How much RAM does your server have? If you're on the low end, then that may be your issue. Or if you have bad custom code....

    Shut down other processes on your server you're not using. By default there are many other things running:

    Tomcat
    PostgreSQL
    SpamAssassin
    Dr.Web antivirus

    Make sure those are off, unless you use them of course.
     
    painthappy, Feb 11, 2008 IP
  5. indyguidedotinfo

    indyguidedotinfo Notable Member

    Messages:
    3,254
    Likes Received:
    202
    Best Answers:
    0
    Trophy Points:
    245
    #5
    thats the beauty of linux. It hardly ever needs a reboot
     
    indyguidedotinfo, Feb 11, 2008 IP
  6. randomIntellections

    randomIntellections Well-Known Member

    Messages:
    985
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    180
    #6

    wrong , all hardware requires reboot once in a while to keep it running healthy.
     
    randomIntellections, Feb 11, 2008 IP
  7. qualityhostings

    qualityhostings Well-Known Member

    Messages:
    1,764
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    105
    #7
    Actually apache will restart silently when you create a domain.
    I do not use apache. I use LiteSpeed webserver on my cPanel server
     
    qualityhostings, Feb 11, 2008 IP
  8. joebert

    joebert Well-Known Member

    Messages:
    2,150
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    145
    #8
    You guys are aware there's a reload that can be used instead of restart when changes are made to conf, right ?

    If I'm not mistaken, Slashdot has equipment that hasn't been rebooted in years.
     
    joebert, Feb 12, 2008 IP
  9. randomIntellections

    randomIntellections Well-Known Member

    Messages:
    985
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    180
    #9
    Care to show some sources ?

    However If you read what I said , servers can run without restarting them for years but if you want to get the best performance out of them you need to restart them once in a while
     
    randomIntellections, Feb 12, 2008 IP
  10. joebert

    joebert Well-Known Member

    Messages:
    2,150
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    145
    #10
    joebert, Feb 12, 2008 IP
  11. aceeca

    aceeca Well-Known Member

    Messages:
    663
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    133
    #11
    There are number of factors that determine whether you can restart Apache. On production servers with high traffic, it is not recommended to restart Apache, so a HUP directive is passed to the kill command.

    --Ace
     
    aceeca, Feb 17, 2008 IP
  12. Host.co.in

    Host.co.in Banned

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Unless you have any specific/genuine cause, I don't think webserver should be restarted.
    It is technically not a proper channel instead you should check for the exact reasons if you are facing problems like server performance, configurations errors or any incorrect script. You can monitor it through the logs and if necessary you can restart it.

    Thank you.
     
    Host.co.in, Feb 17, 2008 IP
  13. RectangleMan

    RectangleMan Notable Member

    Messages:
    2,825
    Likes Received:
    132
    Best Answers:
    0
    Trophy Points:
    210
    #13
    I have one server up for 5 years now..been rebooted a number of times but unless there is an issue Apache, MYSQL, and the rest run for months on end without even a hiccup. That's my freebsd for ya. :)

    Normally the reboots are after I do some upgrading, optimizing, or security checking.

    Five years...and guess what...server is a single hard drive (yes scary) but it's doing well. Gotta love Dell.

    Just tonight I was dealing with a DDOS attack (IPFW rocks).
     
    RectangleMan, Feb 21, 2008 IP
  14. Ladadadada

    Ladadadada Peon

    Messages:
    382
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #14
    I've got a Solaris server that is just coming up to three years since it's last reboot but unfortunately needs one now for some kernel settings to take effect. Apache on that server gets restarted every time we make a change which, for that one, is not very often.

    Back when I was following the uptimes project I saw a verified machine with an uptime of 15 years... and this was 8 years ago. These days there's an 11 year host listed.

    We try not to ever restart things "just to clear them out" because that means we don't know what the processes on our system are doing. (The other reason is that Sun servers do so much self-checking when they are restarted that it's about ten minutes before you can login again.) The best admins can diagnose a problem (such as general slowness) with a server and fix the root cause or the problem without needing a restart.

    If you find that you get a performance boost after a restart it may be a sign that there is a memory leak in a program that never gets restarted. For instance, we got bitten a kernel bug that meant that after three months the kernel was using 90% of our memory. We could have just restarted the box every month or so but the better solution was to talk to Sun until they sent us a patch for the kernel.

    If you find that your Apache child processes slowly grow to use more and more memory then you can set MaxRequestsPerChild in your httpd.conf so that they will get killed off and release any memory they were using after this number of requests. The value you should set this to will depend on how many children you normally have and how much traffic you get. As a very rough guideline, on a busy production server ours are set to 10,000. On my personal website, this value is 4,000 because it doesn't get nearly as much traffic.
     
    Ladadadada, Feb 21, 2008 IP
  15. zacharooni

    zacharooni Well-Known Member

    Messages:
    346
    Likes Received:
    20
    Best Answers:
    4
    Trophy Points:
    120
    #15
    /sbin/service httpd restart

    That usually does the trick.
     
    zacharooni, Feb 21, 2008 IP