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 provides practical steps for Minecraft server owners to improve server performance and reduce lag.
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 the player/entity/plugin/mod/chunk data. A server’s JVM will have to do much more work (garbage collection) to keep up if it does not have enough RAM, which causes lag on the Minecraft server. Minecraft does not have any built-in methods for checking RAM usage, but users can check it by installing the Essentials plugin and using the /memory command. Check out a tutorial on installing plugins on the server here. The server will get an output similar to this when users 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 HoursIf the Free memory is less than 100 MB, there is a high chance that the lag is caused by the server running out of RAM.
Server TPS Lag
TPS stands for ticks per second. TPS measures the performance and stability of Minecraft servers and is capped at 20.00 TPS. Each tick updates the server; a few examples include mob and player movement, growing crops, and sending redstone signals. If the server is running at 20 TPS, it means the server will update 20 times per second.
Users can check the server’s TPS by using the same command we used to check the RAM usage: /memory. Alternatively, if users are running Spigot, they can use the /tps command without installing the Essentials plugin. The server’s TPS should be around 19-20 to run at optimal speed.
Server Lag Fixes
Reduce View Distance
The Minecraft server will run with a default view distance of 10. It is recommended to change the view distance to 6. This will not make any noticeable difference to players, but it can significantly improve the server's performance. Learn how to access the server settings here.
Set up Automated Restarts
Setting up automatic restarts can help the server run more smoothly by freeing up RAM. It can also reclaim RAM used by plugins and mods with small memory leaks. Users can view a tutorial on setting up automated restarts here.
Run the Latest Version
It is recommended to use the latest version of Minecraft, plugins, and mods on the server. Most newer software versions include bug fixes and performance improvements that make the server run faster and more reliably.
Use Spigot
Running Craftbukkit or Vanilla Minecraft on the server can benefit from many performance improvements and bug fixes by simply changing the server JAR to Spigot. Spigot is built on top of Craftbukkit, and all Bukkit plugins will work with Spigot without any changes. Read more about Spigot here.
Remove Unnecessary Mods and Plugins
Having unused plugins and mods on the server will consume server resources even if they are not in use. It is a good idea to remove any unnecessary mods and plugins from the server. If users think the server may use some plugins in the future, but isn't using them right now, disable them by renaming the plugin .jar file to end in .disable. E.g Essentials.jar.disable. Users can remove .disable from the plugin name to re-enable the plugin.
Use the ClearLagg Plugin
ClearLagg offers many features that help users reduce server lag. It is also very configurable and is recommended for any server. Here are a few commands users can use to minimize 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 set up auto-clearing of mobs/entities in the plugin's config file once the server reaches a specified number.
Use WorldBorder Plugin or Default Minecraft Border
Users can use the WorldBorder plugin to limit the world size and pre-generate chunks. This will improve the server's performance because it does not have to generate new chunks when players try to access it. This is also useful if users want to keep the world at a reasonable size. Users can also use the default Minecraft border.
Connection Lag
Latency, or ping, is the time it takes for packets to reach the server from the computer. Users too far from the server will experience high latency, and packets from the computer will take longer to reach the server. For example, if players place a block on the server, it may take a second to actually put it on the server, or if players hit another player, it may take a second for the damage to register. This is because the Minecraft client must send every action to the server, which must verify it and send it back to the client and other players.
Find latency/ping to the server by opening a command prompt/terminal on the computer and using the commands below, depending on the operating system.
Note: 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>
The ping command will run for a few seconds, and once it’s done, it will show 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 the latency to the server exceeds 200ms, it means the client is too far away from the server. There is no way to fix high latency, as it is determined by physical location. However, BisectHosting offers servers in multiple places so players can achieve the best possible latency. Run the ping command on the test servers below to check for lower latency.
| Location | Test Server |
|---|---|
| Amsterdam | ams.bisecthosting.com |
| Atlanta, GA | atlanta.bisecthosting.com |
| Buffalo, NY | buffalo.bisecthosting.com |
| Chicago, IL | chicago.bisecthosting.com |
| Dallas, TX | dallas.bisecthosting.com |
| France | france.bisecthosting.com |
| Germany | germany.bisecthosting.com |
| Hillsboro, OR | hillsboro.bisecthosting.com |
| Hong Kong | hongkong.bisecthosting.com |
| Jersey City, NJ | jersey.bisecthosting.com |
| London, United Kingdom | uk.bisecthosting.com |
| Los Angeles, CA | la.bisecthosting.com |
| Miami, FL | miami.bisecthosting.com |
| Montreal, Canada | montreal.bisecthosting.com |
| Mumbai | mumbai.bisecthosting.com |
| Poland | poland.bisecthosting.com |
| São Paulo, Brazil | brazil.bisecthosting.com |
| Seattle, WA | seattle.bisecthosting.com |
| Singapore | singapore.bisecthosting.com |
| Sydney, AU | sydney.bisecthosting.com |
| Vint Hill, VA | vinthill.bisecthosting.com |
If users experience lower latency at another location, transfer the server to that location at no cost. Learn how to here.
Client FPS Lag
Although the client causes FPS lag, it may be challenging to distinguish between client- and server-caused lag. And for most cases, it is both. For example, if users have a world with 1000 entities, the server's TPS will drop because it has to iterate over those entities once per second. And the client’s FPS will drop because it has to render and keep up with all the entities.
Press the F3 key while playing on the server to display the FPS in the top-left corner. Players should maintain at least 30 FPS while walking around the server for smooth gameplay.
Use Optifine Mod
The Optifine mod offers many configurable features and is recommended for anyone. But most importantly, the Optifine mod can help players achieve higher FTP and smoother gameplay. Download and install Optifine mod here.
Lower Video Settings
Try using the following video settings on the Minecraft client. Adjust the video settings by going to “Options” -> “Video settings” on the client.
Graphics: Fast
Smooth Lighting: OFF
Clouds: Fast
Render distance: 4-8
Use VSync: ON
Entity shadows: OFF
Particles: Minimal