Nothing kills a Minecraft server faster than lag. Here's how to keep your TPS at 20 and your players happy.
JVM Flags & Memory
Use Aikar's flags for optimal garbage collection. Allocate 6-10GB of RAM for most servers — more isn't always better, as it can cause longer GC pauses.
Server Software
Paper is the gold standard for performance. For even more speed, consider Purpur or Pufferfish. Avoid vanilla and Spigot for production servers with more than 20 players.
World Configuration
Reduce view distance to 8-10 chunks, set simulation distance to 6, and use the no-tick-view-distance feature in Paper. Pre-generate your world with Chunky to avoid lag spikes from new chunk generation.
Plugin Audit
Use Spark profiler to identify laggy plugins. Common culprits include poorly coded economy plugins, excessive logging, and plugins that scan entities every tick. Remove or replace anything that consistently appears in profiler reports.
Entity & Redstone Limits
Cap mob spawning rates, limit villager counts per chunk, and throttle redstone updates. These three changes alone can recover 2-5 TPS on busy servers.