If you’ve been facing lag or performance problems with your server, there’s a good chance that your console will be displaying warnings that look similar to this.
If you see these messages, it means that your server is suffering from server-side lag. This can be caused by a lot of different reasons, however, we have a few tips to help you solve it. This guide will teach you how to identify and reduce server-side lag.
What is Server-Sided Lag?
Server lag affects every player on the server, regardless of their internet connection or their PC performance. Server lag is usually measured when a server’s Ticks per Second (TPS) begins to drop. You can view your server’s TPS by using the command
/tps for a Spigot/Paper server. Alternatively, if you are running a Forge/SpongeForge/Fabric server, you can run a Spark Profiler.
Here are general guidelines for TPS rates.
- 20 TPS: your server is running perfectly fine and experiencing no issues.
- 19-20 TPS: Minor lag, however, your server is still fine, with no noticeable lag.
- 17-19 TPS: the server is beginning to struggle. The lag is minor and mostly unnoticeable. It isn’t a cause for concern.
- 17 TPS and below: you will see noticeable lag and issues within your server.
When your server’s TPS drops, the lag becomes apparent to all players on the server. Many simple interactions such as eating food, consuming potions, and breaking blocks will take dramatically longer to complete. Basic mechanics such as the day/night cycle will begin to stutter. In short, the game becomes harder to play.
Causes for Server-Sided Lag
There are many factors to keep in mind when trying to find sources of server-side lag. For example, how much RAM your server has, how your server is configured, and potential in-game causes are the main reasons to look out for.
Not having enough RAM
Your server could be performing poorly, simply because it does not have enough RAM. When the Minecraft engine runs out of RAM, it will try to unload data stored in RAM and write it to the Disk. It then has to read necessary data from the disk into RAM. This process takes a lot of time and CPU usage.
Every mod, plugin, and player all need unique data to be loaded into RAM. So when there is no RAM available, your server will experience lag because of the reshuffling of data between disk and RAM.
We have a guide on choosing what size plan is best suited for your server here. If you are looking to upgrade your server, you can read more on how to do so here.
Configurations in your config files, such as
View Distance and
randomTickSpeed affect task-load on your server. There are also settings particular to certain server versions such as
entity-broadcast-range-percentage for Java 1.15 or 1.16+, and
tick-distance for Bedrock servers.
You can read more on adjusting your View Distance here.
Not only are there specific settings you can change, but there are also different Server Types such as Paper which are built around the goal of optimization. For those who aren’t looking for a modded experience, we highly recommend Spigot or Paper as a server type due to their implemented optimizations and proven stability.
There is a multitude of events that occur in-game that can cause your server to stutter or fall behind. Things to minimize or monitor the use of are as follows:
- Too many Entities: Large mob farms can cause serious lag, especially if the mobs are constantly colliding with each other and jittering about. We have a guide for reducing entity lag here.
- Lighting updates: Many Redstone components cause lighting updates. KeepingRedstone circuits well-lit will reduce the number of lighting updates. Avoid having too many flashing lamps.
- Large fluid updates: Large amounts of moving lava or water can cause lag on your server.
- Hoppers: Any hoppers without a container above them will constantly look to draw in item entities. They will also check their own inventory constantly, check inventories above them and check if it’s pointing into an inventory and if it can push items into that inventory. This, especially in large quantities, can add up and cause a lot of stress on a server.
- Entities with duplicate UUIDs: This occurs more commonly in modded servers but can be caused by in-game bugs. You will see errors in the console regarding ‘entity already exists with UUID’. The only way to fix this is to use the
/killcommand to remove the entity.
- Generating new terrain: Chunk generation is another very heavy task that has the potential to overload your server if a player is moving too quickly, via a boat, minecart, horse, or by flying.
Reducing Server-Sided Lag
Reducing server lag depends on the server type you are using. Therefore we highly recommend you check out our specific guides for each server type and other general ways to reduce lag. You can find them below.
- How to Reduce Lag on a FabricMC Server
- How to Troubleshoot Lag on a Forge Server
- Optimizing spigot.yml to Reduce Lag
- Optimizing bukkit.yml to Reduce Lag
- Optimizing paper.yml to Reduce Lag
- How to take a Timings Report
- How to Pre-Generate Your Minecraft World using WorldBorder Plugin
- How to Automatically Restart Your Minecraft Server
- Using Plugins to Reduce Lag on Your Minecraft Server