MinecraftServerControl / mscs

Powerful command-line control for UNIX and Linux powered Minecraft servers
https://minecraftservercontrol.github.io
BSD 2-Clause "Simplified" License
485 stars 62 forks source link

msctl: cannot fork - thread limit? #250

Closed MrSlimbrowser closed 4 years ago

MrSlimbrowser commented 4 years ago

Hi there, we have set up a bungeecord proxy and 4 spigot v1.15.2 servers on a debian 10 vps. They seem to run fine for a while but after a day or two and seemingly after throwing "mscs restart world1 world2 world3 world4" we get errors like these each time we try to use any mscs other command.

/usr/local/bin/msctl: 595: /usr/local/bin/msctl: Cannot fork
/usr/local/bin/msctl: 603: /usr/local/bin/msctl: Cannot fork

and the last minecraft server that tried to start throws

[0,063s][warning][os,thread] Failed to start thread - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.
Error occurred during initialization of VM
java.lang.OutOfMemoryError: unable to create native thread: possibly out of memory or process/resource limits reached

We have read so far that it should be either a process, or a memory limit. memory is fine, 7 out of 16GB used. We tried upping the process limit by setting DefaultTasksMax=infinity in /etc/systemd/system.conf and raised other ulimits on the fly (ulimit -l, -u and -n to unlimited) but it doesn't help.

Any idea how to find out what limit we run into and how to raise it (or how to fix the cause if the limits should never be reached under normal circumstances)?

sandain commented 4 years ago

I would guess you are running out of memory on your VPS from the error messages you have shown, even though you think it is fine. Some VPS vendors will allocate you a lower limit than stated as dedicated memory, and the remainder as burst. If the system your VPS is on is oversold, that burst memory may not be available. I would check with your hosting provider and ask about this.

sandain commented 4 years ago

@MrSlimbrowser: Hopefully you were able to figure out the issue with your VPS. I am going to close this issue, but feel free to reopen it if necessary.