Fixing lag: when the server stutters
How to spot lag, what the Performance tile in the Panel means and what helps.
A Minecraft server recalculates the world 20 times per second. If it can't keep up, it falls behind and writes Can't keep up! to the log. Players notice this as lag: blocks reappear, mobs jump, doors open late. Navoryx Insight continuously measures every Minecraft server's TPS. It also measures what the server spends its time on: which mod or plugin, entities by type, hoppers and other block entities, new chunks, redstone. You'll find it in the Panel console under Performance, including the places with the most entities.
Falling behind right after a start is normal while the world loads. We don't count it.
Click Leistung (performance) in the console. At the top you see what costs the most time right now, for example chickens or hoppers, and where in the world most entities are. Copy /tp puts the command on your clipboard so you can paste it in game. Below that are all causes and the latest stutters with their time. The exact numbers are under More details.
Under Fix with one click the Panel offers matching measures, for example removing items from the ground, reducing villager AI load, reducing hopper load, faster redstone, lowering view or simulation distance, installing Lithium or turning off a slow mod. Beforehand it says exactly what happens and whether the server restarts. Afterwards it shows what the fix achieved. Changed settings are backed up first and can be undone under Done.
Memory almost full: Java keeps cleaning up and pauses the server while doing it. Remove mods or plugins you don't need, lower the view distance or book more RAM in the customer area.
CPU maxed out: Minecraft calculates the world on a single core. Lots of mobs, big farms, redstone clocks or a heavy plugin slow it down. To find the cause:
- Paper and Purpur: run
/spark profiler start, play for a few minutes, then/spark profiler stop. The link shows what takes the most time. - Forge, NeoForge and Fabric: install spark from the Installer under Mods and measure the same way.
- Limit or remove what's at the top: shrink farms, pen in mobs, turn off redstone clocks.
Short spikes: usually the server is generating new chunks because someone is running or flying far away. Pre-generate the world with Chunky (in the Installer) so the server doesn't have to generate while you play.
- In
server.properties, lowerview-distanceto 8 andsimulation-distanceto 6. - Restart the server so the values apply.
If the cause says our machine was busy, it's not on you. We're notified automatically and take care of it.