Fix "Can't keep up! Is the server overloaded?"

[Server thread/WARN]: Can't keep up! Is the server overloaded? Running 2000ms or 40 ticks behind means one thing: a tick took longer than the 50 milliseconds it is allowed. The server skipped ticks to catch up, players saw rubber-banding and mobs froze for a moment. The line says nothing about why.

The four causes, in order of how often we see them

  1. Something in the world is expensive. A farm with thousands of entities, a redstone clock, a chunk loader keeping a mob grinder alive while nobody is near, hoppers by the hundred. The warning appears when players are in that area, or all the time if it is chunk-loaded.
  2. World generation. Players exploring new terrain make the server generate chunks, which is the heaviest thing it does. Modded worlds with big worldgen mods (Terralith, Tectonic, Biomes O’ Plenty) make it worse. The warning stops when exploring stops.
  3. Garbage collection pauses. A Java server whose heap is nearly full pauses to clean up. This shows as regular stalls every few seconds rather than a steady slowdown, and it is the one case where more RAM fixes it.
  4. Too many mods or plugins doing work every tick. A single misbehaving plugin can take 30 ms of every tick on its own.

Hardware is rarely the cause on FadeHost: each server has its own CPU share on a dedicated machine, and a single tick runs on one core, so a faster CPU is not something you can buy your way into.

Find which one you have

  1. When the slow ticks last ten minutes with players on, the server page shows an amber tick-health banner with the number. Press Profile now on it. Without the banner, the Performance tab has the same button as Run profile; press it while the lag is happening, with players on.
  2. Within a minute or two a spark link appears. Open it, press flat at the top, pick Server thread. The list is sorted by how much of each tick a thing takes, and the deepest entry with a mod or plugin name in it is the answer. The lag guide has a table of the usual entries and what they mean.
  3. Garbage collection shows at the top of the profile. Frequent long “Old” pauses are the memory case; young pauses of a few milliseconds are normal.
  4. A profile dominated by chunk loading while players fly around is world generation. One dominated by tickBlockEntities or tickEntity is a build: go where the players were when it lagged.

Fix it

  • An expensive farm or clock: remove it, or move it out of a chunk loader so it only runs when someone is there. On Paper, lower entity-activation-range in spigot.yml and mob-spawn-range in bukkit.yml, and raise ticks-per.hopper-transfer and ticks-per.hopper-check in spigot.yml so hoppers do less work per tick.
  • World generation: pre-generate the area players will use with Chunky (chunky radius 3000 then chunky start in the console) while nobody is online, and lower the view distance. The pre-generation guide has the numbers.
  • Garbage collection: this is the RAM case. If the profile shows long Old pauses and the memory graph on the server page sits near the top, add a gigabyte in Billing.
  • A plugin or mod: update it, replace it, or remove it. The profile names it, so there is no guessing.

What does not help

  • Restarting every hour. It hides the symptom for a while and never names the cause.
  • max-tick-time=-1. That only stops the watchdog from killing a server that hangs for a full minute; it does nothing for ticks that are slow rather than stuck.
  • More RAM, unless the cause is the heap. A server with a 3 GB heap and a lag machine on it lags exactly the same at 8 GB.

If the profile does not make sense to you, send the spark link from Support and we read it with you.

Something missing or wrong? Tell us or ask in Discord.