Can I debug what causes my server freeze? I know my custom plugins cause that, but it's not single-php-file-with-30-lines plugin. It's impossible to remove some codes and test for 24 hours, and restore it back. My server runs for sometime before it freeze. While it freeze, the server can still be queried, but not typing commands from even console. It have many players, for avarage, 70. Minigame server. I really needs the help in this. Much appreciate to you guys.
Search "while" and "for" in your code and rethink their breaking logic one by one. An ordinary plugin, even a large one, shouldn't have too many loops, and you could pay attention to recent code. If rethinking doesn't work, add breakpoint debug lines to make sure they are not executed infinitely. PHP: while($strangeCondition){ echo "Strange condition is still true!\n";} Protip: If you are on a git repo: Code: git grep -eain \(for\|while\)\\\( On Un*x: Code: grep -eai --line-numbe \(for\|while\)\\\( In PhpStorm: Right-click directory/file -> Find in Path
Thanks for the detailed answer, I will report back tomorrow whether that works or not. By the way, can 100% load server (a.k.a 0 TPS server) be frozen? How to be sure that is not freezing in loop or something, but heavy load?
If your server is at 0 TPS, most likely it's not frozen. A server with main thread frozen does absolutely nothing on the main thread, including responding to console commands, allowing clients to join, reporting the server TPS in the process title, etc. So if you are able to know its TPS, most likely it's not completely frozen. Of course it's also possible that your server is gradually decreasing in TPS, tending towards 1/∞.