Log inSign up

Diagnose low TPS and lag spikes on a Minecraft server

Measure before changing anything: on Paper, mspt and spark tps show how long each tick takes, and spark profiler start --timeout 300 points at the plugin, entity or chunk work behind it. A healthy server keeps ticks under 50 ms; most fixes come from lower simulation distance, pre-generated chunks, fewer entities and correct heap flags.

Topic: Game and voice servers · Tested on: Ubuntu 24.04 and 22.04, Debian 12 and 13 · Updated 2026-12-03

Is it server lag, network lag or the client?

Start by naming the kind of lag, because each has a different cure. Server lag means the world itself slows down: mobs freeze, crops stop growing, and every player sees blocks reappear after mining them. Network lag affects one player or one region: that person rubber bands while others play normally. Client lag is a low frame rate on one computer, with the server perfectly healthy.

The quick test is the tick rate. Minecraft targets 20 ticks per second, which leaves a budget of 50 ms for each tick. If TPS stays at 20 and mspt stays well below 50 while one player complains, the problem is not on the server. If TPS drops for everyone at once, keep reading.

How do I measure TPS and tick time?

Paper shows both numbers out of the box, and the spark profiler (bundled with recent Paper builds, otherwise installed as a plugin) adds percentiles and memory data. Send the commands through the console FIFO from the server setup guide, or type them in game as an operator.

echo "tps" | sudo tee /run/minecraft.stdin
echo "mspt" | sudo tee /run/minecraft.stdin
echo "spark tps" | sudo tee /run/minecraft.stdin
echo "spark healthreport" | sudo tee /run/minecraft.stdin
sudo journalctl -u minecraft -n 40 --no-pager

Read mspt as the true signal. A server can still report 20 TPS while its ticks average 45 ms, which means it is one busy farm away from falling behind. Spikes in the 95th percentile, rather than the average, usually explain short freezes that players notice.

How do I find what is eating the tick?

Record a profile during the lag, not after it. Start the sampler, wait while players do whatever triggers the slowdown, and let it upload a report:

echo "spark profiler start --timeout 300" | sudo tee /run/minecraft.stdin
sudo journalctl -u minecraft -f

After five minutes spark prints a link to an online viewer. Expand the Server thread tree and follow the widest branches. Typical findings include one plugin listener that runs on every move event, chunk generation during exploration, huge item or mob counts in a single chunk, and hoppers or redstone clocks in a farm. For memory problems, spark heapsummary lists the largest object types and spark gc shows how often garbage collection pauses the game.

Which server settings reduce lag the most?

Simulation distance is the strongest lever. It decides how far around each player the server ticks mobs, crops and redstone, while view distance only decides how far players can see. Lowering the first and keeping the second gives most of the saving with little visual loss.

# server.properties
view-distance=10
simulation-distance=6

In spigot.yml, entity activation range reduces work on mobs that are far from players, and merge radius combines dropped items. In config/paper-world-defaults.yml, useful keys include the per-chunk entity save limits, item and arrow despawn rates, and hopper settings. Change one thing at a time, restart, and measure mspt again so you know which change helped. Keep notes in a text file beside the config, because many of these options interact.

Why pre-generate the world?

Generating new terrain is one of the most expensive things a server does, and it happens exactly when players explore. Generating a fixed area in advance turns that cost into a one-time job you run at night. The Chunky plugin does this well:

echo "chunky world world" | sudo tee /run/minecraft.stdin
echo "chunky radius 4000" | sudo tee /run/minecraft.stdin
echo "chunky start" | sudo tee /run/minecraft.stdin
echo "chunky progress" | sudo tee /run/minecraft.stdin

Pair it with a world border of the same size (worldborder set 8000) so nobody walks into ungenerated land. Watch disk growth with du -sh /opt/minecraft/server/world; a large radius takes several gigabytes. NVMe storage on the High Frequency plans keeps chunk loading quick once the area exists.

Are my Java flags and heap size right?

Give the server a fixed heap and a garbage collector tuned for short pauses. Set -Xms and -Xmx to the same value, about 1 to 1.5 GB below the plan memory, and use the G1 flag set that the Paper documentation recommends:

/usr/bin/java -Xms6G -Xmx6G -XX:+UseG1GC -XX:+ParallelRefProcEnabled \
  -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC \
  -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 \
  -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 \
  -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 \
  -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 \
  -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 \
  -jar paper.jar --nogui

Put that line in the ExecStart of your systemd override. More heap is not always better: an oversized heap with little free RAM pushes the system into swap, and swapped Java pauses badly. Check with free -h that the box keeps free memory after the server has run for an hour.

How do I check the VPS itself?

Look at CPU, memory and disk from the system side to rule out a resource limit. These commands need no extra setup:

top -o %CPU
free -h
vmstat 5 5
sudo apt install -y sysstat && iostat -x 5 3

In top, a Java process near 100 percent of one core means the main thread is saturated: only a faster tick or fewer tasks will help. The st value shows CPU time taken by the host; a steady high reading is worth a support ticket. High wa in vmstat points at disk waits, often from backups running during play. The usage graphs tutorial explains the console charts that show the same picture over days.

What about players with network lag?

Ask the affected player for a trace, and run one from the server back to them. mtr shows where latency or packet loss starts:

sudo apt install -y mtr-tiny
mtr -rwc 50 203.0.113.50

Loss that begins on the player side is outside your control. If most players are far away, a server in a city closer to them fixes it; see the city list. More detail on reading reports is in the mtr guide.

When is a bigger plan the right answer?

Upgrade after the profile, not before. If spark shows the main thread busy with normal gameplay, settings are already reasonable and players still push mspt over 50, the server needs a faster or roomier machine. Moving from F2-4 to F3-8 adds memory for chunks and entities; for large public worlds F4-16 gives room for pre-generated maps and plugins. Deploy the new plan, copy the server folder over, and switch DNS, as in moving to a larger plan.

Plans that fit this guide

Base city prices. Every plan includes a dedicated IPv4 address, IPv6, full root and all 18 images.

All prices
PlanFits becauseSizeMonthlyOrder from
F3-8room for plugins and pre-generated chunks3 vCPU, 8 GB RAM, 256 GB NVMe$28.80/mo$86.40 for 3 months
F4-16large public worlds4 vCPU, 16 GB RAM, 384 GB NVMe$57.60/mo$57.60 for 1 month

Questions about Find and fix Minecraft lag

What TPS should a healthy server show?

A steady 20 TPS with mspt well under 50 ms. Short dips during world saves are normal; long drops are not.

Does adding vCPUs fix low TPS?

Only partly. The main tick runs on one thread, so extra cores help with chunk loading, networking and garbage collection, but a single busy loop still needs fast cores and less work per tick.

Should I use a lag clearing plugin that deletes items?

Treat it as a last step. Fixing the farm or setting that creates the entities is better than deleting them on a timer, which annoys players and hides the real cause.

Can a backup job cause lag?

Yes, compressing a large world competes for CPU and disk. Run backups at quiet hours, give tar a lower priority with nice -n 19, and use the save-off and save-on sequence.

Why does lag start after the server runs for days?

Memory leaks in plugins and growing entity counts are common causes. Compare spark healthreport output from a fresh start with one from day three, and schedule a nightly restart if needed.