/
mc-node.net →
Minecraft

How do I fix Minecraft server lag with the Spark profiler?

Updated 31/08/20264 min read
In this article
  1. First, the basics: TPS, MSPT and 'Can't keep up'
  2. Step 1: Install Spark
  3. Step 2: Profile while the lag is happening
  4. Step 3: Read the report
  5. Common causes and how to fix them
  6. Optimising further

Your server feels sluggish: blocks snap back after you break them, mobs freeze, commands respond late and the console prints Can't keep up! Is the server overloaded?. There is no need to guess which farm or plugin is to blame — the free Spark profiler measures exactly where every tick loses its time. In this guide you install Spark, capture a profile while the lag is happening and turn the report into a concrete fix.

First, the basics: TPS, MSPT and 'Can't keep up'

A Minecraft server runs at 20 ticks per second (TPS). Every tick the server updates the entire world, and it has at most 50 milliseconds to do so. MSPT (milliseconds per tick) is how long a tick actually takes. As long as MSPT stays below 50 you get a smooth 20 TPS; once it climbs above that, TPS drops and literally everything on the server slows down.

The message Can't keep up! Is the server overloaded? Running 2000ms or 40 ticks behind means exactly that: ticks took too long, the server fell behind and is now skipping ticks to catch up. Seeing it once during startup is harmless; if it keeps coming back while people are playing, you have genuine server lag.

First check that the problem really is server-side. Low FPS or stuttering visuals (especially with shaders) is client lag; rubber-banding with a high ping is connection lag. Type /spark tps: if it shows a steady 20 TPS with low MSPT, look at the client or the network instead.

Step 1: Install Spark

  1. Running Paper or Purpur 1.21 or newer? Spark is already built in. Type spark tps in the Console tab of the MC-Node panel; if you get a response, skip straight to step 2.
  2. Otherwise download Spark from spark.lucko.me/download. Pick the Bukkit version for Paper/Spigot, or the Fabric/Forge/NeoForge version for a modded server.
  3. Open the Files tab in the panel and upload the jar to the plugins folder (on a modded server: mods).
  4. Restart the server from the Console tab and confirm the command works with spark tps.

Step 2: Profile while the lag is happening

The biggest pitfall: profiling an empty or freshly restarted server. Without players online, the farms, hoppers and chunks causing the lag are not running, so the report shows nothing. Start the profiler at the moment the lag actually occurs, with players on the server.

  1. Wait for the lag to appear, or have players reproduce the situation (for example at the suspicious farm).
  2. Type in the console: spark profiler start --timeout 300. The profiler measures for 5 minutes and stops automatically. Without --timeout, stop it yourself with spark profiler stop.
  3. Let everyone keep playing normally; the measurement itself costs barely any performance.
  4. When it finishes, the console prints a link to spark.lucko.me. Open it in your browser.

Step 3: Read the report

  1. At the top you can see the TPS and MSPT during the measurement — this confirms you actually captured the lag.
  2. Open the tree under the server thread and keep expanding the row with the highest percentage. That walks you down to the task eating most of the tick time.
  3. Recognise the patterns: lots of time in entityTick or mob AI points to too many entities; HopperBlockEntity to hopper lines; chunk generation or ServerChunkCache to chunk loading; and a package name like com.example.pluginname singles out that one plugin as the culprit.

Common causes and how to fix them

  • Too many entities — Usually mob farms or piles of dropped items. Set /gamerule maxEntityCramming 8 (default 24), lower the spawn-limits in bukkit.yml and the entity-activation-range in spigot.yml, and give large farms an on/off switch.
  • Hoppers — Long hopper lines check for items every single tick. Raise ticks-per.hopper-transfer in bukkit.yml (for example from 8 to 16) and, on Paper, set hopper.cooldown-when-full to true in config/paper-world-defaults.yml. Replace very long lines with water streams and fewer hoppers.
  • Chunk loading and worldgen — Exploring players force the server to generate new chunks. Lower the simulation-distance in server.properties (for example to 6) and optionally the view-distance, set a world border and pre-generate the world with the Chunky plugin: /chunky radius 3000 followed by /chunky start.
  • One plugin at the top — Update the plugin first, disable heavy features (scans, animations, holograms) in its config, or look for a lighter alternative. You can test by temporarily moving the jar out of plugins and restarting.
  • 'Can't keep up' only during startup — Harmless: the server is catching up after the startup spike. Only act if the message returns during normal play.
  • TPS is 20 but players still complain — Then it is client or network lag: lower the render distance or disable shaders on the client side, or investigate the ping.

Optimising further

Did you use /timings in the past? Our article on creating timings is outdated; Spark is its modern successor. You will find structural improvements in our optimisation guide, and whether a lack of memory plays a part is covered in the RAM guide. Still stuck? Open a ticket via our support page and include the link to your spark report — we will gladly take a look.