How to troubleshoot and reduce lag on a Minecraft server(Legacy)


Summary
There are various ways to troubleshoot and reduce lag on a Minecraft server. Several potential lag causes exist, such as excessive entities, redstone circuits, and plugins. Solutions include adjusting server settings, optimizing plugins, and upgrading hardware. It is vital to regularly monitor server performance and take action to reduce lag as soon as possible to ensure an enjoyable gameplay experience. The guide below will provide practical guidance for Minecraft server owners to improve their server's performance and reduce lag.

How to Troubleshoot and Reduce Lag on a Minecraft Server

Common Reasons

- Too many mods/plugins.
- Server is running out of RAM.
- Too far away from the server.
- Using an outdated version of Minecraft.
- Too many entities/items in the world.

Types of Lag

- Server side lag (TPS lag)
- Connection lag (High latency/ping)
- Client side lag (FPS lag)


Server Lag
Server is running out of RAM
RAM is the lifeblood of Minecraft servers; it is used to store your player/entity/plugin/mod/chunk data. Your server’s JVM will have to do a lot more work (garbage collection) to keep up if you don’t have enough RAM and this causes lag on your Minecraft server. Minecraft does not have any built-in methods for checking the RAM usage, but you can check the RAM usage by installing the Essentials plugin and using the command /memory. You can find a tutorial on how to install plugins on your server
here. You will get an output similar to this when you run this command.

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

We need to look at the output of Free memory for now, we will discuss other outputs later in the tutorial. If the amount of Free memory is less than 100MB, then there is a big chance the lag is caused because your server is running out of RAM.

Server TPS Lag
TPS stands for ticks per seconds. TPS is used to measure performance and stability of Minecraft servers and is maxed at 20.00TPS. Each tick will update your server; few examples are movements of mobs and players, growing crops, sending redstone signals. If your server is running at 20 TPS, it means your server will update 20 times per second.

You can check server’s TPS by using the same command we used to check the RAM usage: /memory. Alternatively, if you are running Spigot, you can use the command /tps without having to install the Essentials plugin. Your server’s TPS should be around 19-20 for your server to run at its optimal speed.


Server Lag Fixes
Reduce View Distance
Your Minecraft server will run at view distance of 10 by default. We recommend changing your view distance to 6, this will not make any noticeable difference to players, but this can hugely help your server performance. You can learn how to access your server settings here.

Setup Automated Restarts

Setting up automatic restarts can help your server run smoother by freeing up your server RAM usage. It can also reclaim RAM that gets used by plugins and mods that have small memory leaks. You can view our tutorial on how to setup automated restarts here.

Run the Latest Version
We recommend using the latest version of Minecraft, plugins, and mods on your server. Most newer versions of software will include bug fixes and performance improvements that will make your server run faster and more stable.

Use Spigot
If you are running Craftbukkit or Vanilla Minecraft on your server, you can benefit from many performance improvements and bug fixes by simply changing your server JAR to Spigot. Spigot is built on top of Craftbukkit and all your Bukkit plugins will work with Spigot without needing to make any changes. You can read more about Spigot here.

Remove unnecessary mods and plugins
Having unused plugins and mods on the server will use up server resources even if the plugins and mods are not being used. It is a good idea to remove any unnecessary mods and plugins from the server. If you think you may use some plugins in the future and are not using right now, you can disable plugins by renaming the plugin .jar file to end with .disable. E.g Essentials.jar.disable. You can remove .disable from the plugin name to enable the plugin again.

Use ClearLagg plugin
ClearLagg comes with many great features that you can use to reduce lag on your server. It is also very configurable and is recommended for any server. Here are few examples of commands that you can use to reduce lag with this plugin.

/lagg clear - Removes all entities on the server.
/lagg killmobs - Removes all mobs on the server.
/lagg chunk - Locate possibly laggy chunks.
/lagg unloadchunk - Unload unneeded chunks.
/lagg gc - Attempts to free RAM.

It is also possible to setup auto clear mobs/entities once the server has reached a specified amount of mobs/entities on config file for this plugin.

Use WorldBorder Plugin or Default Minecraft Border
You can use the WorldBorder plugin to limit the world size and pre-generate chunks for your world. This will improve the performance of your server because the server does not have to generate new chunks when players try to access it. This is also useful if you want to keep your world at a reasonable size. You can also use default Minecraft border.


Connection Lag
Latency, or otherwise known as ping is the time it takes packets from your computer to reach the server. If you are located too far away from the server’s location, you will have high latency and packets from your computer will take longer to reach the server. For example, if you place a block on the server, it may take a second to actually place the block on the server or if you hit a player, it may take a second to register the damage. This is because your Minecraft client has to send every action to the server and the server has to verify these actions and send it back to your client and other players.

You can find latency/ping to your server by opening command prompt/terminal on your computer and using the commands below depending on your operating system.

IMPORTANT: Don’t include the port number; just enter the server IP address.

Windows:
ping -n 5 <server_ip>

Mac/Linux:
ping -c 5 <server_ip>

Ping command will run for few seconds and once it’s done, it will show your the average ping to the server.

Fast latency: 0-100ms
Medium latency: 100-200ms
Slow latency: 200-300ms
Laggy latency: 300+ms


Connection Lag Fixes
If your latency to the server is higher than 200ms, that means you are located too far away from the server. There is no way to fix high latency because it is based on your physical location. However, we offer servers in multiple locations so players can get the best latency as possible. You can run the ping command on our test servers below and check if you get a better connection with another location.

Premium Servers
Location
Test Server
Dallas, TX
dallas.bisecthosting.com
Buffalo, NY buffalo.bisecthosting.com
Los Angeles, CA la.bisecthosting.com
Montreal, Canada montreal.bisecthosting.com
United Kingdom uk.bisecthosting.com
France france.bisecthosting.com
Hillsboro, OR hillsboro.bisecthosting.com
Vint Hill, VA vinthill.bisecthosting.com
Miami, FL miami.bisecthosting.com
São Paulo, Brazil brazil.bisecthosting.com
Germany germany.bisecthosting.com
Poland poland.bisecthosting.com
Sydney, AU sydney.bisecthosting.com
Singapore singapore.bisecthosting.com

Budget Servers
Location
Test Server
Montreal, Canada
montreal.bisecthosting.com
France
france.bisecthosting.com


If you get a better latency with another location, we can transfer your server to that location for free of charge. You can request a location transfer by opening a ticket
here.


Client FPS Lag
Although FPS lag is caused by the client it may be difficult to differentiate lag caused by FPS and the server. And for most cases, it is both. For example, if you have a world with 1000 entities, your server TPS will drop because the server has to iterate over entities and it will do this every tick per second. And your client’s FPS will drop because it has to render and keep up with all the entities.

You can press F3 key on your keyboard while you are playing on the server and it will display your FPS on the top left. You should have at least 30FPS while walking around the server for smooth gameplay.


Client FPS Lag Fixes
Use Optifine Mod
The Optifine mod comes with many configurable features and is recommended to anyone. But most importantly Optifine mod can help players achieve higher FTP and smoother game player. You can download and install Optifine mod here.

Lower Video Settings
Try using the following video settings for your Minecraft client. You can adjust your video settings by going to “Options” -> “Video settings” on your client.

Graphics: Fast
Smooth Lighting: OFF
Clouds: Fast
Render distance: 4-8
Use VSync: ON
Entity shadows: OFF
Particles: Minimal


Was this answer helpful?

0
« Back