Mine Hour logo

How to Fix Lag on a Minecraft Server: TPS and RAM Guide

Low TPS, blocks breaking late and freezes: learn how to diagnose lag with spark, tune RAM, view-distance, Java flags and pre-generate the world.

· 8 min read

black flat screen computer monitor turned on beside black computer keyboard

How to fix lag on a Minecraft server: a TPS and RAM guide

"The server is lagging" is the phrase most often heard in any group that plays Minecraft with friends. And it almost always comes with the wrong solution: someone increases the RAM, someone uninstalls the plugin they installed last, someone restarts the server for the fifth time that day. Sometimes it works by luck. Almost always, it doesn't.

In this guide, you'll learn how to find the cause of the lag before changing anything: measuring TPS and MSPT, reading a spark report, adjusting view-distance, applying the Java flags, and pre-generating the world with Chunky. The order matters more than the number of adjustments.

The 2026 context applies: Mojang changed the numbering scheme, and the stable Java Edition version is 26.3 (the "Wilderness Bound" drop), with 26.4 still in snapshots. The concepts below apply to any recent version, but always check whether your Paper, plugin, or mod already has a build for the version you're running.

First: what kind of lag is this?

There are three different problems that everyone calls "lag," and each one is solved in a different place:

  • Server lag (tick lag): the world freezes, mobs freeze, blocks take a while to break, redstone misses the pulse. A CPU and server load problem.
  • Client lag: your FPS drops, the game stutters, but everyone else keeps moving normally. A problem on your machine, shaders, client render distance.
  • Network lag: high ping, rubberbanding (you get pulled back), blocks that reappear. A connection problem or distance to the server.

Before optimizing, ask the group: is everyone freezing or just me? If it's just you, the problem isn't the server. If it's everyone at the same time and the world freezes, it's tick lag — and that's where the rest of this guide comes in.

TPS and MSPT: the two numbers that matter

The Minecraft server runs on ticks. The ideal is 20 ticks per second, which gives 50 milliseconds of budget per tick (MSPT, or milliseconds per tick). If the work for one tick exceeds 50 ms, the server can't complete 20 ticks and TPS drops.

In practice:

  • 20 TPS = all good.
  • 15 to 19 TPS = you can already feel it on farms and in combat.
  • Below 10 TPS = practically playing in slow motion.

In Paper, the /tps command shows the values for the last minute, 5 minutes, and 15 minutes. Look at all three: an isolated one-second spike isn't a problem; consistently low TPS over 15 minutes is.

Step 1: measure with spark before changing anything

spark is the free profiler used by practically everyone who administers a server. It runs on Paper, Fabric, Forge, NeoForge, and Velocity — and on Paper it's already available by default, without installing anything.

The secret is recording the profile while the lag is happening. Recording with an empty server shows nothing.

/spark tps
/spark health
/spark profiler start
# espere de 2 a 5 minutos, com jogadores online e o lag rolando
/spark profiler stop

The stop generates a link with the report. In it, you see, in a tree format, where the tick time is being spent: entities, chunk generation, plugin tasks, redstone, hoppers. It's the difference between guessing and knowing.

Two other useful commands:

/spark gc
/spark heap summary

The /spark gc shows how the Java garbage collector is doing. If long, frequent pauses appear there, the problem may be poorly configured memory — not the world.

Golden rule: measure, change one thing, measure again. Changing ten settings at once doesn't let you know what fixed it.

Step 2: RAM and Java flags (the famous Aikar's flags)

Here lies the most common myth: more RAM doesn't make the server faster. RAM is the space for the world, the number of players, and the plugins. What defines tick speed is the CPU and the Java configuration.

A small server with Paper and a few plugins runs well with 4 to 6 GB. Servers with 20 to 40 players, many plugins, and a large world are usually in the 8 to 12 GB range. Throwing 32 GB at a 10-person server only increases the garbage collector's work.

Aikar's flags are a set of JVM options that tune the G1 collector for short, frequent pauses instead of long, rare pauses. Long pauses are felt as freezes. Below is the classic set for servers up to 12 GB (set -Xms and -Xmx to the same amount of memory):

java -Xms8G -Xmx8G -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 \
-Dusing.aikars.flags=true -Daikars.new.flags=true \
-jar paper.jar nogui

Two details that make a difference:

  1. -Xms equal to -Xmx avoids resizing the heap in the middle of the game.
  2. Keep the JVM new. Run the server with a recent version of Java 21 (or higher, depending on your Minecraft version's requirement), not with the system's old Java.

In hosting, these flags usually already come applied in the panel. If you host on an hourly service like Mine Hour, the memory adjustment is usually a field in the panel, and ideally you should increase RAM only when /spark gc shows that memory is truly at its limit.

Step 3: view-distance and simulation-distance

Two settings explain much of the lag on servers with many players spread across the map:

  • view-distance: how many chunks each player receives to see. It costs bandwidth and CPU to send.
  • simulation-distance: how many chunks around the player actually "work" (mobs moving, plants growing, redstone running). It costs real CPU.

In server.properties:

view-distance=8
simulation-distance=6

For a friends' server, view-distance=8 is already quite comfortable. 10 or more on a full server is one of the most common causes of low TPS — and the visual gain compared with 8 is much smaller than the cost.

If you use Spigot or Paper, it's also worth reviewing spigot.yml:

world-settings:
  default:
    entity-activation-range:
      animals: 24
      monsters: 24
      misc: 8

These values define how far entities continue to be processed. Reducing them cuts CPU cost without breaking simple farms.

Step 4: Pre-generate the world with Chunky

Generating chunks in real time is one of the biggest causes of sudden TPS drops: someone flies far away with an elytra and the server has to create terrain on the spot. The solution is to generate it beforehand.

The Chunky plugin is the standard for this. Before running it, set a world border — there is no point in pre-generating an infinite radius:

/worldborder center 0 0
/worldborder set 10000
/chunky world world
/chunky center 0 0
/chunky radius 2000
/chunky start

Chunky's radius is in blocks, not chunks. Start small (500 to 1000), see how much time and disk it uses, and only then increase it. During generation, TPS is lower — that's normal, the server is working. You can control the intensity:

/chunky pause
/chunky continue
/chunky cancel
/chunky confirm

Practical tip: run pre-generation at an empty time, make a backup beforehand, and save the world afterward with save-all. Repeat for world_nether and world_the_end if your server uses these dimensions on a daily basis.

Step 5: entities, farms, and redstone

If spark pointed to specific entities or blocks, the problem is content, not configuration. The usual suspects:

  • Giant mob farms with hundreds of items on the ground. Dropped items are entities and cost ticks.
  • Hoppers in series, especially in large, always-active storage systems.
  • Too many villagers in trading halls or automatic blacksmiths.
  • Redstone in a loop running 24 hours a day with no need.
  • Always-loaded chunks (chunk loaders) in areas no one is using.

A /kill @e[type=item] in an emergency solves the moment, but the real solution is to review the farm's design. And if the problem is a plugin, the spark report shows exactly which task is consuming the tick — including economy or logging plugins that run a heavy task every second.

Step 6: choose the right software

The server software changes performance before any configuration:

  • Paper (or forks such as Purpur) is the de facto standard for servers with plugins: far more optimized than Vanilla and compatible with most plugins.
  • Fabric with performance mods is the choice for those who play with mods. The names worth mentioning are Lithium (general game logic optimizations), FerriteCore (reduces memory usage), Krypton (optimizes networking), and C2ME (multithreaded chunk generation). Always check whether a build already exists for the version you use.
  • Forge/NeoForge with large modpacks: here the bottleneck is usually the number of mods, not the flags. It is worth looking for alternative versions of the heaviest mods.

Order of attack (checklist)

  1. Confirm that it is tick lag (everyone lagging, world freezing).
  2. Run /spark tps and /spark health.
  3. Record a profile with /spark profiler start during the lag.
  4. Adjust view-distance and simulation-distance.
  5. Check RAM and Java flags (Aikar's flags).
  6. Pre-generate the world with Chunky within a worldborder.
  7. Reduce entities and review farms, hoppers, and redstone.
  8. Repeat the measurement and compare.

Conclusion

Lag is not solved by guessing. If you follow the order — measure, adjust distances, review memory and Java, pre-generate the world, and only then look at entities and plugins — you will solve most cases without having to reinstall anything. And when the bottleneck is truly hardware, the hosting server itself becomes the variable: it is worth testing a machine with a stronger CPU before continuing to cut game features.

If your goal is just to play with friends without becoming an infrastructure administrator, Mine Hour offers Paper, Fabric, Forge, Spigot, and Vanilla servers that start in less than a minute and pause themselves when the last player leaves — useful for testing performance settings without paying for idle hours.

Sources