Report this

What is the reason for this report?

Server keeps going down and restarts after about 15 minutes

Posted on June 6, 2018

Hi,

I’m using a server to facilitate online multiplayer in my PC game. The server is a small application written in Java. The problem is that the server keeps going down occasionally and restarts itself automatically after about 15 minutes. I have upgraded the server a couple of times but it didn’t seem to make any difference, first I used an 1 GB 1 vCPU 20 GB standard droplet, after that an 8 GB 4 vCPUs 160 GB standard droplet and finally I tried a CPU Optimized Droplet with 4 GB 2 vCPUs 20 GB. I’m not completely sure but it seemed that the server went down when there were about 15 people online, but at times there are the same amount of people online (or more) and no crash occurs. It crashes about 1-2 times a day when most people are online (but I’m not 100% sure).

Graphs: -1 minute after server crashed (7:29 pm) : https://imgur.com/a/Asit3O6 -Server down for 12 minutes (7:41 pm): https://imgur.com/a/ulIgTau -Server back online (7:50 pm): https://imgur.com/a/gMOn4Jf -Server back online for 28 minutes (8:18 pm): https://imgur.com/a/lA8dufN

Console: -After server crashed (7:39 Pm): https://imgur.com/a/h7r701H it shows: java.net.SocketException: Connection reset

-After the server is back online (7:50 pm): https://imgur.com/a/l85FYFw

The only thing I recognize is the ClientThread.java file which is one of the 3 java files that comprises the server. I must also say that my experience with Java is very basic and that someone else made the java server files (who is not available), but I understand most part of it and made some small adjustments myself.

Any reason why this server keeps crashing occasionally?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

It sounds like that the server might be running out of memory.

What I could suggest in such cases is to open a second terminal and run htop or top and keep an eye on the server resources utilization.

That way you will be able to tell what might be happening.

You can also check your system logs at /var/log and see if there are any out-of-memory errors in there.

If this is the case, what you could do is add some extra RAM to the server or add a swap file so that you could have some extra buffer:

https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-20-04

Best,

Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.