EnderGrid Logo EnderGrid
← Back to Blog

Minecraft Server Optimization Guide: Fixing Lag

Published: August 2024 • 6 min read

If your server is experiencing rubber-banding, delayed block breaking, or TPS (Ticks Per Second) dropping below a perfect 20.0, you have a lag problem. This guide will help you optimize your configuration to get your server running smoothly again.

1. Change Your Server Software (Do not use Vanilla)

The single biggest improvement you can make is abandoning the default Mojang Vanilla jar file. It is not optimized for multiplayer environments with lots of players. You should upgrade to:

2. Reduce View Distance & Simulation Distance

Found in your server.properties file.

3. Optimize Paper Configs (paper-world-defaults.yml)

If you are using Paper, there are specific changes you can make inside the configurations to limit entity CPU usage:

4. Use Aikar's JVM Flags

Java's default garbage collection (GC) can cause sudden lag spikes (freeze-ups) as it clears out old memory. Using Aikar's flags switches Java to the G1GC garbage collector tuned specifically for Minecraft.

Note: If you use a high-quality host like EnderGrid, optimized JVM flags are already applied to your server upon startup, so you don't need to manually configure them!

5. Pre-generate Your World

When players walk into new territory, the server has to mathematically generate mountains, caves, and biomes from scratch. This causes "chunk generation lag".

Use a plugin like Chunky. You can command it to generate a 5,000 x 5,000 block radius around spawn while no one is online, saving those chunks to disk. When players visit those areas later, the server just reads a file instead of doing heavy math.