Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Webservers - Questions All the Time
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Webservers - Questions All the Time

GM2015GM2015 Member
edited September 2015 in Help

How important is it to restart services on a webserver?
Would restarting them have any beneficial effect on the server's stability?
My digitalocean 1GB server is up for almost 52 days(record for me) and just wonder whether there's a point in it.
From earlier observations, some services(like mysql) drop their "caches"(I think) from memory and use less memory when restarted. But then they go back again to normal usage.
Why is a standard mysqld process(lots of them) eating 21% of ram on ubuntu with mostly standard config?

The server's run by serverpilot.io free package. nginx,apache2.4,mysql5.5.x,php5.6-fpm

edited for flawless grammarz

Comments

  • restarting can help clear emails stuck in mail queue, lowering a bit of mysql load and not much else really. But it can help apache from crashing suddenly sometimes. We usually do a soft reset of services once a week to avoid some of these. Just a precaution really.

    Thanked by 1Falzo
  • I only restart after a kernel upgrade...all of my vpses restart within 5 seconds or less, dedicated with datashack was only around 2 minutes or so before it was back up and my server at dacentec took the longest with around 6-8 minutes to completely be back up after a reboot.

  • Things that are cached in RAM don't actually block it. It is still free for other applications to use it.

    free -m shows the usage with cache and without cache

  • serverpilot@server:~$ free -hm
                 total       used       free     shared    buffers     cached
    Mem:          994M       928M        65M       120M        57M       357M
    -/+ buffers/cache:       513M       480M
    Swap:         511M         0B       511M
    
  • Just in case there are some nasty memory leak bugs, restart the process could mitigate the problem.

  • @GM2015,

    Memory for 'buffers/cache used' (513M) is too high. Normally, only around of 1/4 x 1GB (= 250 GB).

  • telephonetelephone Member
    edited September 2015

    Majority of the time, I only restart services after upgrading. To check whether services need restarting after an upgrade, use the following:

    Debian based: checkrestart, found in the debian-goodies package.

    Other OS (dpkg, rpm, or pacman based): needrestart

  • @ceibaNet said:
    usually do a soft reset of services once a week to avoid some of these. Just a precaution really.

    +1

  • creepcreep Member
    edited September 2015

    edited.

  • weekly restart is good for the server in a lot of way. It clears cache and etc.

  • I usually don't restart stuff. They have to be stable!

  • risharderisharde Patron Provider, Veteran

    Most of the reliable hosts hardly ever restart their servers unless its kernel updates as previously mentioned. Normally I tend to think that if you have to restart your webserver often, there is something wrong with software or configuration on it, this is especially true if you are running linux. I have had webservers that go at least half a year without needing to restart. Of course, if you simply are trying to srrve more than your server capacity.. then restarting isnt going to be a long term solution either.

Sign In or Register to comment.