Skip to content

How To Troubleshoot and Reduce Lag on a Minecraft Server

Overview

There are several methods to address and minimize latency on a Minecraft server. Various factors, including excessive entities, redstone circuits, and plugins, can contribute to lag. The solutions involve adjusting server settings, optimizing plugins, and upgrading hardware. It’s crucial to regularly monitor the server’s performance and take immediate action to reduce lag for an enjoyable gameplay experience.

The following guide provides practical advice for Minecraft server owners to enhance their server’s performance and decrease latency.

Troubleshooting and Reducing Lag on a Minecraft Server

Common Causes

  • Excessive number of mods/plugins.
  • Insufficient RAM allocation for the server.
  • Long distance from the server location.
  • Using an outdated version of Minecraft.
  • There is a high number of entities/items in the game world.

Types of Lag

  • Lag originating from the server itself (TPS lag).
  • Lag caused by connection issues (high latency/ping).
  • Lag experienced by individual players (FPS lag).

Server Latency

Insufficient allocated RAM for the server

RAM plays a crucial role in Minecraft servers as it stores player/entity/plugin/mod/chunk data. Your Minecraft server may experience lag if there is insufficient RAM, as the server’s JVM will need to work harder (perform garbage collection) to keep up.

Unfortunately, Minecraft does not provide built-in methods for checking RAM usage. However, you can install the Essentials plugin and use the /memory command to monitor RAM usage. You can use the Plugin Installer on the AleForge Panel to search for and install this plugin. When executing the /memory command, you will receive an output similar to this;

The End "world_the_end"; 625 chunks, 18 entities, 0 tiles.
Nether "world_nether"; 0 chunks, 0 entities, 0 tiles.
World "world"; 625 chunks, 215 entities, 14 tiles.
Free memory; 1,715 MB.
Allocated memory; 1,963 MB.
Maximum memory; 1,963 MB.
Current TPS = 20
Uptime; 20 Hours

Let’s focus on the Free memory output; we’ll cover the others later in this tutorial. If the amount of free memory is below 100MB, it’s highly likely that lag is occurring due to insufficient RAM on your server.

Server TPS Lag

TPS (ticks per second) is a metric used to gauge the performance and stability of Minecraft servers, with the maximum value being 20.00 TPS. Each tick represents an update cycle for your server, which includes actions like mob and player movements, crop growth, and redstone signals.

To check your server’s TPS, you can use the same /memory command we did to check RAM usage/memory. Alternatively, if you’re using Spigot, you can utilize the /tps command without needing to install the Essentials plugin. It’s ideal for your server’s TPS to be around 19-20 in order to ensure optimal performance.

Fixes for Server Lag

Reduce View Distance

By default, Minecraft servers have a view distance set at 12 blocks. If you are having lag on your server, you can experiment with lowering this value as it can greatly enhance server performance at the cost of rendering less of the world at a time. You can edit this value from the Server Properties page of the panel.

Set up Automated Restarts

[Configuring automated restarts](https://help.aleforge.net/article/144-how-do- i-setup-an-automated-backup-of-my-server) can help maintain smoother server operation by freeing up RAM usage and reclaiming memory taken by plugins or mods with minor memory leaks.

Run the Latest Version

Make sure you’re running the most up-to-date version of Minecraft and any plugins and mods on your server. The latest software versions usually come with bug fixes and performance enhancements that can optimize your server’s speed and stability.

Use Paper

Consider switching to Paper if you’re currently using Craftbukkit or Vanilla Minecraft. Paper is built on top of Craftbukkit, so all your plugins will work seamlessly without requiring any modifications. You can find more information about Paper here.

Remove Unused Mods and Plugins

Removing any unnecessary mods and plugins from your server is important to avoid wasting valuable server resources. Even if they’re not being used, they still consume resources. If you think there may be some plugins you’ll use in the future but aren’t using right now, you can disable them by renaming the plugin.jar file with a “.disable” extension (e.g., Essentials.jar.disable). To re-enable a plugin, simply remove the “.disable” from its name.

Try the ClearLagg Plugin

Consider utilizing the ClearLagg plugin to help reduce lag on your server. It comes equipped with various useful features and is highly customizable, making it a recommended choice for any server owner.

Here are a few examples of commands that you can use to improve server performance by reducing lag;

  • Use the command /lagg clear to remove all entities on the server
  • To get rid of all mobs on the server, enter /lagg killmobs
  • If you suspect certain chunks may be causing lag, try using /lagg chunk to locate them
  • Unload unnecessary chunks by typing /lagg unloadchunk
  • Lastly, free up RAM by running the command /lagg gc

It’s possible to automatically clear mobs and entities once your server reaches a specified number. You can configure this in the plugin’s configuration file.

Add a World Border

To optimize your server’s performance further, consider using the WorldBorder plugin or stick with Minecraft’s default border. The WorldBorder plugin allows you to limit the size of your world and pre-generate chunks. By doing so, players won’t have to wait for new chunks to be generated when they explore. This is especially helpful if you want to keep your world at a manageable size.

Connection Lag

Let’s talk about connection lag. Latency or ping refers to the time it takes for packets from your computer to reach the server. If you’re located far away from the server location, you may experience high latency and delays in packet transmission.

For instance, when you place a block on the server, there might be a slight delay before the block is actually registered on the server. Similarly, if you hit another player, the damage may take a moment to be recognized. This delay occurs because your Minecraft client has to send each action to the server, which then verifies and sends it back to your client and other players.

To determine the latency or ping to your server, follow these steps based on your operating system;

Windows;

1. Open the command prompt on your computer.

2. Enter ping n 5 <server_ip> without including the port number. Replace <server_ip> with your server’s IP address or hostname.

Mac/Linux;

1. Open Terminal on your computer.

2. Enter ping c 5 <server_ip> without including the port number. Replace <server_ip> with your server’s IP address or hostname.

Once completed, the ping command will run for a few seconds and display the average ping to the server.

Fast Latency0-100ms
Medium Latency100-200ms
Slow Latency200-300ms
Laggy Latency300ms

If you experience high latency (above 200ms), it suggests that you are located far away from the server. Unfortunately, there is no direct fix for high latency, as it depends on the physical distance between you and the server location.

However, our services provide servers in various locations to ensure players can enjoy the best possible connection speed. To check if you can improve your connection, you can run a ping command on our test servers listed below.

LocationTest Server
Dallas, TXtx1.aleforge.net
Los Angeles, CAca3.aleforge.net
Vint Hill, VAva1.aleforge.net
Germanyfr4.aleforge.net
Sydneysy1.aleforge.net
Singaporesg1.aleforge.net

If you experience better latency with a different location, we are happy to transfer your server there free of charge. Simply request a location transfer by opening a ticket here.

Client FPS Lag

It is important to note that both the client and the server can cause FPS lag. It may be challenging at times to distinguish between them as they often occur simultaneously. For instance, let’s say you have a world with 1000 players. In this case, the server’s TPS (ticks per second) will decrease because it needs to go through each character during every tick in a second. As a result, your client’s FPS (frames per second) will also drop as it has to render and keep up with all these characters.

To check your FPS while playing on the server, simply press the F3 key on your keyboard. Your FPS will be displayed on the top left corner of your screen. Ideally, you should aim for at least 30FPS while navigating through the server to ensure smooth gameplay.

Fixes for Lagging Client FPS

Use Optifine

Optifine is a mod for Minecraft that offers various customizable features and is highly recommended for all players. Most importantly, it can help increase your FTP (frames to process) and provide a smoother gaming experience.

Adjust Video Settings

Try adjusting the following video settings in your Minecraft client by going to “Options” > “Video settings”.

Graphics Option| Setting|

---|---|---
Graphics| Fast|

Clouds| Fast|

Smooth Lighting| Off|

Render Distance| Between 4-8 Chunks|

VSync| Enabled|

Entity Shadows| Disabled|

Particles| Minimal|

By making these adjustments and using the Optifine mod, you should see improvements in your client’s FPS performance.