Paper: An optimization suggestion.

Created on 2 Jul 2020  路  4Comments  路  Source: PaperMC/Paper

Describe the solution you'd like

  • Stop mob generation when the server's CPU usage or memory usage reaches below a value.
  • Turn on mob generation when the server's CPU usage or memory usage reaches below a value.

Just add two setting options to the configuration of Paper.
This feature can effectively prevent server latency caused by high CPU usage or high memory usage.

wontfix feature

Most helpful comment

CreatureSpawnEvent

if (Bukkit.getTPS[0] <= 19.99)
{

event.setCancelled(true);

}

All 4 comments

CreatureSpawnEvent

if (Bukkit.getTPS[0] <= 19.99)
{

event.setCancelled(true);

}

It is recommended to set a global variable, and then use timer timing to determine whether to turn on mob generation. When the system wants to generate mob, it only needs to judge this global variable.

A Plugin can easily achieve this by setting mob limits to 0 for however many ticks it wants based on the tps. However mob spawn lag usually only happens due to a bad config.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mibby picture mibby  路  3Comments

Brokkonaut picture Brokkonaut  路  3Comments

greenywd picture greenywd  路  3Comments

tazuuuu picture tazuuuu  路  3Comments

successed picture successed  路  3Comments