pterodactyl / panel

Pterodactyl® is a free, open-source game server management panel built with PHP, React, and Go. Designed with security in mind, Pterodactyl runs all game servers in isolated Docker containers while exposing a beautiful and intuitive UI to end users.
https://pterodactyl.io
Other
6.75k stars 1.72k forks source link

Consider CPU when scheduling servers to a node #3828

Open donfor opened 2 years ago

donfor commented 2 years ago

Is there an existing feature request for this?

Describe the feature you would like to see.

Like you can set a maximum for total memory and total disk space for a node, you should be able to set a maximum CPU-usage, which the daemon/(wing) can't exceed. There are several use cases:

  1. when you are running other software on the wing-server, this software has guaranteed CPU-resources free and will work as expected (yes, you can do that on each single server, but read the next point)
  2. when it would work with the API, you wouldn't have to set up an own table (or wherever to store this lonely value), in which you store the maximum amount of a node, so you can calculate with the API-data, if there is room for another server.
  3. there is a feature for total memory and total disk space - so why not for CPU-usage?

It would be safer, easier and more equally, when implementing this feature

Describe the solution you'd like.

In the panel you can just add another input-field in the "Allocation Limits"-Section in the node-settings.

Additional context to this request.

No response

Boy132 commented 2 years ago

Wings automatically reads how many cpu threads are available: image I agree however that this information should also be shown in the "At-a-glance" section on the right.

Like you can set a maximum for total memory and total disk space for a node, you should be able to set a maximum CPU-usage, which the daemon/(wing) can't exceed.

The allocated resources are purely for display (and also for api usage) so admins can see how much they wanted to allocate and how much they really allocated. The "real limit" is the actual available ram/ disk space.

DaneEveritt commented 2 years ago

Are you asking for something like setting the node maximum CPU usage as 400%, and if you try to allocate a server to that node and it would go over to treat it like we do currently with Disk & Memory limits?

That gets a little messy when you start dealing with 0 for CPU limits, but I guess in that case it is just going to have to make a decision as best it can, similar to disk and memory.

trenutoo commented 2 years ago

Are you asking for something like setting the node maximum CPU usage as 400%, and if you try to allocate a server to that node and it would go over to treat it like we do currently with Disk & Memory limits?

That gets a little messy when you start dealing with 0 for CPU limits, but I guess in that case it is just going to have to make a decision as best it can, similar to disk and memory.

That's what was discussed on Discord. It would behave the same as disk and memory limits, e.g., when it's 0, it doesn't count towards the total.