Is it a good practice to restart VPS server everyday?

bl flag

I am building an app server using Ubuntu 20.04 and will be serving thousands of clients with potentially a million http messages everyday. I wanted to ask if it is a good practice to restart my server everyday at midnight? I think this will help release any memory issues, clear cache, etc. and make my server operate fast everyday. I am getting this idea from using my laptop, performs really bad if I dont restart once a week.

Side question: How would one code this in Kotlin or Python (to restart the VPS and then launch my server .jar file after the restart)?

raj avatar
cn flag
If you need to restart your server everyday to get rid of memory problems etc. it means your software is bad and has severe bugs. You should update it or replace your software by a better one that has no such bugs. Properly configured server should be able to run for months or even years without a need to restart.
ru flag
18.04 is no longer supported, and has entered ESM which is not covered on Ask Ubuntu per its current community guidelines and policy. You should upgrade to at least 20.04 for your environment.
Cool_Coder avatar
bl flag
Updated the Ubuntu version to 20.0 @ThomasWard-OnStrike
Cool_Coder avatar
bl flag
I dont know if there are memory leaks or not yet as the app is not built yet. Just wanted to know whether its a normal thing or not to restart the server @raj
vn flag

No. This is a very bad practice.

As @raj states, a properly configured server running properly coded software should never have to be restarted, unless needed because of security updates.

So build your app without memory leaks, and you should be good.

Cool_Coder avatar
bl flag
thanks for the answer! I have no app code yet, just wanted to know if its a standard practices to restart the server every week. I got this idea because I need to restart my laptop once every week or its very slow!
I sit in a Tesla and translated this thread with Ai:


Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.