Pryaxis / TShock

☕️⚡️TShock provides Terraria servers with server-side characters, anti-cheat, and community management tools.
GNU General Public License v3.0
2.41k stars 377 forks source link

Been having issues with servers crashing #1053

Closed Kromara closed 9 years ago

Kromara commented 9 years ago

I'm currently running 3 servers all on the official 4.3.6pre2 build. Approximately every 30-45 minutes a server will crash and there is usually no error message, but approximate 1 out of every 6 times an OutOfMemory error appears. Here is a screenshot of that message: http://puu.sh/j8Svq/32e66606be.png Usually though, no error message appears and no player will be able to connect. If anyone attempts to connect, it just gets stuck at "Found Server". When I use the /off command to reboot the server with my automatic rebooting script, I usually get this error: http://puu.sh/j8Xuc/024e3ff813.png The second error appears nearly every time. It seems that the servers are more prone to crashing when more players are online. It just seemed odd to me that I was getting an OutOfMemory error when each server is only running at approximately 800MB of memory usage at peak performance, with total memory usage at about 40% of maximum, even during server crashes.

Kromara commented 9 years ago

I downsized to 2 servers from 3 and I'm still getting the same results. I watched as both servers went unresponsive with no errors at all. My TShockIRC bot on one of the servers disconnected and all players were unable to talk in chat, although the players on the server with the active IRC bot were still able to receive messages from that bot. There also are no leaving messages when a player leaves the server and the server shows that each player is still connected. I also noticed that there was almost no fluctuation in the Memory usage for each client when this occurred.

hakusaro commented 9 years ago

tylerjwatson commented 9 years ago

Hi OP.

Next time this happens, could you please post a memory dump by downloading the ProcDump commandline tool, and executing procdump.exe -ma <PID of TerrariaServer.exe>, and uploading the dump? Zip it for ease of sending.

If you have troubles using procdump let me know.

Kromara commented 9 years ago

@tylerjwatson Should I just run this and keep it running until one of the servers crashes? Or does it not quite work that way?

hakusaro commented 9 years ago

No, run it only when the server has crashed. It dumps the entire process (800mb+) to a file.

Kromara commented 9 years ago

I see. Thanks.

hakusaro commented 9 years ago

:+1:

Kromara commented 9 years ago

1443MB this time around. Should I just post it here? Or send it privately somehow to someone? Slack, possibly? Compressed down to ~140MB though ^_^

hakusaro commented 9 years ago

@Kromara PM it to me on slack

tylerjwatson commented 9 years ago

Hi OP,

I have received your memory dump. The OOM is caused by thread exhaustion caused by a plugin, as you can see inthe screenshot below.

image

There are about 400 threads running, all deadlocked on SBPlanet Package!SBPlanetPackage.Extensions.TSPlayerExtensions.GetPlayerInfo.

In future, before posting bug reports to TShock, please remove all third party plugins beforehand; it's a serious waste of time and resources debugging things like this for something I can't fix - we can't fix plugins. Seek the author of that plugin.

Cheers.