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.
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
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.
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
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).
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
+1
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!
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.