Minecraft server lagging? The settings that actually help
How to find and fix Minecraft server lag: TPS vs network lag, Paper, view distance, entity limits, chunk pre-generation and plugin profiling.
"The server is lagging" can mean two different problems. Fixing the wrong one wastes hours, so the first step is to find out which one you have.
Server lag or connection lag?
Check TPS (ticks per second). A healthy server runs at 20. If TPS is low, the server itself is struggling. If TPS is 20 but players still rubber-band, the problem is their connection or the host's network.
1. Run Paper instead of vanilla
Paper is a drop-in replacement for the vanilla server with major performance improvements and many settings for tuning. For plugin servers it is the usual starting point.
2. Lower view and simulation distance
These two settings in server.properties have the biggest effect. Simulation distance decides how far away mobs and farms keep running; lowering it saves a lot of work without changing how far players can see as much.
3. Control entities
Huge mob farms, piles of dropped items and thousands of minecarts slow servers down. Use Paper's entity limits and item-merge settings, and find the worst chunks.
4. Pre-generate the world
Generating new chunks while players explore is expensive. Pre-generate the map with a plugin such as Chunky, and set a world border.
5. Profile before guessing
A profiler such as spark shows exactly which plugin, entity or chunk is using the most time. Fix the top item first; it is often one plugin or one farm.
6. Give it enough memory, but not too much
Too little RAM causes stutters, and too much can make garbage collection pauses worse. Use sensible startup flags and leave memory for the operating system.
If your server struggles once players join, I can profile it, tune it and set limits so it holds 20 TPS.