pelican-eggs / eggs

Service eggs for the pterodactyl panel
MIT License
2.85k stars 2.32k forks source link

[Bug]: Minecraft servers run out of container memory causing server freeze #1709

Closed henrikx closed 2 years ago

henrikx commented 2 years ago

Panel Version

1.8.1

Wings Version

1.6.4

Service

minecraft

Modified

No, I did not modify the egg

Expected Behavior

Container memory should be enough for Java itself as well as the JVM. The default startup command uses -Xmx{{SERVER_MEMORY}}M, but the startup command should subtract from the server memory to allow room for other processes within the container to use memory. I suggest something like 500MB + 10% of container memory for the -Xmx-argument.

Actual Behavior

Server freezes when the Minecraft server allocates it's set -Xmx memory and there is not enough memory left for Java itself and the other processes within the container.

Steps To Reproduce

Install logs

Pteropaste is down at the time of writing. Also the install logs are not really relevant, as the issue is clearly with the startup-command of the egg.

henrikx commented 2 years ago

Other people had this issue: https://www.reddit.com/r/admincraft/comments/ork1la/misconfigured_pterodactyl_crashing_servers/

parkervcp commented 2 years ago

The panel already adds a base amount to all containers for subservices. You should be able to sit at max ram usage. What you are describing is going past that limit.

Software-Noob commented 2 years ago

I have a PR to improve on this https://github.com/pterodactyl/panel/pull/4146

Pteropaste is also not down and has not been down.

henrikx commented 2 years ago

The panel already adds a base amount to all containers for subservices. You should be able to sit at max ram usage. What you are describing is going past that limit.

Perhaps there should be a server-setting for how much this base amount is?

I have a PR to improve on this pterodactyl/panel#4146

Pteropaste is also not down and has not been down.

This looks excellent. It should be merged as soon as possible. For me, the default egg has repeatedly resulted in server crashes, and I am sure it does for many others who are unaware.

My apologies for the pteropaste. I tried the suggested command but it would not work, so I believed it was down. Still, none of my logs are required to repair this, so it should not be a problem.

Software-Noob commented 2 years ago

Perhaps there should be a server-setting for how much this base amount is?

It's a Wings config value.

henrikx commented 2 years ago

Perhaps there should be a server-setting for how much this base amount is?

It's a Wings config value.

I'm assuming these are the relevant lines?

  overhead:
    override: false
    default_multiplier: 1.05
    multipliers: {}

They are not documented in https://pterodactyl.io/wings/1.0/configuration.html and the settings are not present in the UI, so I did not know about them.

Software-Noob commented 2 years ago

Perhaps there should be a server-setting for how much this base amount is?

It's a Wings config value.

I'm assuming these are the relevant lines?

  overhead:
    override: false
    default_multiplier: 1.05
    multipliers: {}

They are not documented in https://pterodactyl.io/wings/1.0/configuration.html, so I didn't know about them.

Indeed. It's a new configurable option that has not made it to the documentation yet.

https://github.com/pterodactyl/wings/blob/develop/config/config_docker.go#L102-126

I would still personally recommend my PR method as it leaves specific amount for the container without increasing the whole container max memory limits.

ImUrX commented 2 years ago

I suggest looking at this tbh: https://aikar.co/mcflags.html

parkervcp commented 2 years ago

Please note that the aikar flags specifically call out not using the AlwaysPreTouch flag as an issue. Though if you are raising the default multiplier higher it may just be fine to use. On a default setup this will cause issues.

henrikx commented 2 years ago

Closing this as #4146 is merged. Thank you.