This article provides tips for diagnosing and improving performance issues on dedicated servers, particularly when running large maps with many entities.
Check Server Performance
You can identify whether the server is struggling by running the debug command in the server console.
Example:
Updates per second: 16%
Ticks per second: 100%
Active zombies: 13
Active animals: 7Ticks Per Second
Ticks Per Second (TPS) measures whether the server simulation is keeping up with real time.
100% TPS indicates the server is running correctly. If TPS drops below 100%, the server is unable to process game logic fast enough and players may experience lag.
Updates Per Second
Updates Per Second (UPS) affects how frequently information is sent to connected players.
Lower UPS can make the game feel less responsive. Though, TPS is generally the more important metric when diagnosing server-side performance issues.
Check Entity Counts
The logmemoryusage command provides information about how many entities are active on the server.
Example:
16 memory usage result(s):
[0] Players: 24
[1] Groups: 16
[2] Vehicles: 50
[3] Barricade regions: 30
[4] Barricades placed on ground: 200
[5] Zombies: 1525
[6] Alive zombies: 1460
[7] Alive boss zombies: 0
[8] Ticking zombies: 4
[9] Animals: 30
[10] Animal packs: 25
[11] Ticking animals: 10
[12] Item regions: 270
[13] Dropped items: 3460
[14] Structure regions: 6
[15] Structures placed: 79
Large counts of vehicles, zombies, animals, dropped items, barricades, or structures can increase CPU usage and memory consumption.
Improving Performance
Max Entity Spawns: Reducing the max number of vehicles, zombies, and animals can help improve performance. Large maps often have significantly more entities than other maps, which can meaningfully impact performance even when zombies are outside of areas with player activity.
Hardware: CPU is a major factor in determining server responsiveness. Even if a server has plenty of RAM available, performance issues can occur if the CPU cannot process updates quickly enough.
Plugins and Mods: Temporarily disable plugins/mods when troubleshooting performance issues. Some plugins may have a significant impact on server performance.