GitBook: [#76] CPU limitations

This commit is contained in:
OpenSource 2022-08-24 05:12:00 +00:00 committed by gitbook-bot
parent cd5c638214
commit 974367ff24
No known key found for this signature in database
GPG Key ID: 07D2180C7B12D0FF
4 changed files with 45 additions and 3 deletions

View File

@ -7,9 +7,9 @@
* [📜 Current Config files](overview/config.md)
* [🚫 Limitations](overview/limitations/README.md)
* [Permission-based RAM](overview/limitations/permission-based-ram.md)
* [Permission-based CPU](overview/limitations/permission-based-ram-1.md)
* [Max players limitation](overview/limitations/max-players-limitation.md)
* [Max plugins limitation](overview/limitations/max-plugins-limitation.md)
* [CPU](overview/limitations/cpu.md)
***

View File

@ -6,6 +6,10 @@ On pages below, you'll learn how to set permission-based limitations for your p
[permission-based-ram.md](permission-based-ram.md)
{% endcontent-ref %}
{% content-ref url="permission-based-ram-1.md" %}
[permission-based-ram-1.md](permission-based-ram-1.md)
{% endcontent-ref %}
{% content-ref url="max-players-limitation.md" %}
[max-players-limitation.md](max-players-limitation.md)
{% endcontent-ref %}

View File

@ -1,2 +0,0 @@
# CPU

View File

@ -0,0 +1,40 @@
---
description: Learn how to make a permission-based CPU system for your players
---
# Permission-based CPU
## Introduction
We know that making a permission-based CPU system is a crucial to our customers and could be greately used for safety of your infrastructure and preventing overload as well as for stores in order to motivate players to upgrade to a higher rank, so we've implemented a permission-based CPU system. In this tutorial, you'll learn how to configure it for your needs.
{% hint style="warning" %}
This feature is only working if you have Pterodactyl or Docker enabled. Screen based servers can not have CPU limitations.
{% endhint %}
## Tutorial
In order to begin, you'll need to change a few config options. Make sure your cpu-limiting part of the config looks as following:
```yaml
cpu-limiting:
# Only for docker-based servers,
# should we use permissions for cpu management? If set to true, you MUST give
# your players permission playerserver.cpu.<amount> (ex: playerserver.cpu.1)
# or, else, the command will be blocked, and player will not be able to create
# the server. If set to false, everyone will have cpu-per-server amount of CPU.
use-permissions: false
# How much CPU (in %) should we allocate to each PlayerServer?
cpu-per-server: 50
```
By enabling use-permissions, the plugin will ignore cpu-per-server option and will use permission-based CPU management system.
The next thing you'll wanna do is to give all the groups that have `playerserver.manage` permission a new permission as following: `playerserver.cpu.<cpu as percentage>`. Here's an example in LuckPerms:
```yaml
/lp group default permission set playerserver.ram.100
```
In the following example, we gave the role default ability to create a server with 1 CPU core.