8 December, 2022
Lag is a major concern for server owners. Lag can be caused by a variety factors, including the resources your server uses or the hardware it runs on. Apex hosts servers so hardware shouldn't be an issue. There are many ways to reduce lag.
There are plugins that can reduce lag. You can upgrade your server RAM, switch to a more optimized Minecraft jar, optimize your files, etc.
You may be wondering what causes lag, and how to eliminate it. There are three types of lag: latency, TPS, and FPS. This guide will provide a breakdown of the various types of lag that can occur and the best ways to minimize it on your Minecraft Server.
Types Of Lag
Server Lag (TPS)
TPS (Ticks per Second) is a measure of overall server performance. TPS (Ticks Per Second) is a server's heartbeat. Your server beats at a fixed rate, 20 ticks per second. That's one tick every 0.05 seconds.
Every tick brings about a slight change in various aspects of the server. Mobs move and grass grows, animals spawn, just about everything on the server depends on ticks. Normal gameplay will be possible at 20 TPS when the server is running at its peak performance. If your server's TPS drops, you will notice lag in your game.
The server's performance and the hardware it runs on play a significant role in determining its TPS. Inadequate hardware can lead to the same fate as mismanaging the server.
You should consider the long-term consequences of any mods or plugins you add to your server. Many server owners mistakenly believe that the server's number is the only factor that affects its performance. Although the number of players on a server can have an impact, it is not as significant as the impact of mob farms, redstone machines, and mods/plugins. TPS drops are primarily caused by what is happening in your world at any given time.
Client Lag (FPS)
Low FPS can cause your game to behave slowly. A low frame rate can make it feel like you are watching a slideshow. A low frame rate on your server doesn't necessarily mean that the server is slowing down, but that your computer is not keeping up with the game. You will need to adjust your game settings, update drivers, or upgrade your graphics card, RAM, and CPU if you have a low frame rate.
It is important to understand the difference between server lag or low FPS. Sometimes, low FPS and server lag can occur simultaneously. You may think that the FPS is due the server's lag, but it is often an issue with your device.
There are many ways to fix low FPS without needing to upgrade your hardware. You can adjust the video settings in Minecraft to reduce certain functions. You can also turn off clouds to save your computer from trying to render them. It is also a good idea not to run any other processes in the background. This will free up resources for the game. This can be done quickly by closing any open Taskbar items.
Another option is to switch your device to the high-performance plan under its power options. Windows PC users can switch to the high-performance plan by pressing Windows Key + X. This will open a new context menu. To open your settings, choose "Power Options". Change the Power Mode to "Best performance".
Connection Lag (Ping)
Your ping is related to your connection lag. Ping is the latency in the network between your server and your game. This is the time it takes for data to be processed and transported in milliseconds. High ping can cause your connection to the server to time out. High ping is not a sign of lag. It can cause lag. It can also cause the game to crash due to instability.
A low ping is better as it allows for smoother gameplay. Your ping will increase the farther away a server is to your physical location. This can be minimized by moving your server to the closest location to you and your players. There are many factors that can affect ping, including Internet connection speed, quality of an Internet service provider, issues within the Minecraft servers network, and configuration of firewalls.
Latency can vary depending on network conditions and server status. By "pinging" a server, you can determine how latency is on that server. This will tell you how long it takes for a server to respond to a message. There are several ways to test your server's ping. We recommend using your command prompt. You can open a terminal or command prompt with Windows+X, and then type "ping ServerIP". For example, "ping play.apexmc.co" Although the process can take up to a second, you should be able to see the average ping once it is completed.
Creating a Timings Report
A timings report lets you monitor the time it takes for your server's event to process. This will allow you to identify lag issues that could cause your server's TPS to drop. To run a timings analysis, join your server and run the command "timings on". After 30 minutes, you can run the command "timings paste". This will give you a link. Click on it to open your report in your browser.
Reading a Timings report
The timings report's top section will include a simple graph showing your server's average TPS over five minutes. The graph's left side shows a brief summary of your server, including the average TPS. These are great for getting a quick overview of your server's performance, but they won't tell you why your server is slowing down. You will need to examine the data section below the graph to determine the root cause of the lag.
The lower section of a timings reports is a detailed breakdown of all ticks that occurred during the reporting period. It is also known as a 'treeview'. Each tree gives a broad overview of the type of tick that is occurring. The top tree will often give a summary of the average ticks for the entire server. Click on these trees to expand and view more information about each layer. You will be able see which block or entity is ticking and how long it takes to tick once you have reached the end of the series.
A timings report will automatically sort information so that the processes that take longer to complete appear first. These items are often the root cause of any server lag. The fastest way to find the source of your lag is to go through the top trees. Once you have identified the cause, you can either go back to your server to remove it or modify your settings to reduce its impact.
It can be intimidating to read a timings report. There are many resources that can help you if you get lost or are unsure of what you are reading. Contact our support team for the best solution. Our tech support agents are experts in timing reports and can help you analyze them or guide you through how to read one if you get stuck.
How do you fix a slow Minecraft server
Server lag can be prevented by optimizing your server. There are many tools that you can use to optimize your server and push it beyond its normal performance limits.
Removing tick/lag machines
Redstone is a great mechanic for creating almost any type of machine. However, too many machines can cause problems. This will reduce your TPS and cause lag for everyone. This can be solved by limiting the machines and installing anti-redstone lag plugins such as this one. You should limit the number of automated farms, mob grinding machines, and other devices that require complex redstone mechanics. You should include a way to shut down your farms and machines so that they don't consume your server's resources.
Pre-generating your world
Pregenerating the world is an important step in lag elimination. This must be done before any other steps. This is best done with the Chunky plugin. You can install the plugin by running the following commands: http://chunky-radius.5000 followed closely by http://chunky start.
This will pre-generate a radius of 5,000 blocks around your world spawn. While the process is still running, the server will be slow but your performance will improve tremendously. You can increase the radius however much you wish, but we recommend that it not exceed 20,000 blocks. You could create more lag than what you are trying to prevent by making it larger.
The view distance from the server.properties files is one option. Any number between 6-8 will optimize the server and not affect gameplay. To improve performance, it is recommended that you change the "Net Compression Threshold", which is 64 by default, and the "Max Tick Time", to -1.
We recommend switching to Paper if you are currently running Vanilla or Spigot. Paper provides excellent performance due to its many optimization and anti-cheat capabilities.
Optimizing your config files
Some of the main files that you will want to modify to really optimize your server are Bukkit.yml, Paper-world-defaults.yml, and Spigot.yml. Below are the settings that you should change to achieve the best performance and minimize any impact on your gameplay.
These settings can be used by stopping your server from your control panel and clicking on the tabs below. This will display the optimized settings for each individual file. These files are located in the FTP File Access tab on your control panel. The paper files are located within the "config" directory. You can open them online by clicking the "edit" button located to the right of the file. After you're done editing, click the green "Save" button and restart the server to apply the changes.
Plugins
Not only is it possible to reduce or eliminate lag by changing the base server files, but there are other ways. Many plugins are available that can reduce lag. After installing a few plugins, you will notice a significant reduction in lag on your server. Here's a list of plugins that we recommend the most to our users.
ClearLagg (1.8+)
Limit Pillagers (1.14+)
Village Optimiser (1.14.2+)
MergedMobs (Premium 1.7+)
Entity Tracker Fixer (1.14+).
Farm Limiter (Premium 1.7+)
Mob Farm Manager (Premium 1.7+)
Lag Assist (Premium 1.8+)
Spark (1.8+).
StackMob (1.16+).
Armor Stand-Limiter 1.8+
Although these plugins won't stop all lag from your server, they can help. This guide will help you install plugins on Minecraft servers.
Bedrock Optimization
Your Bedrock server's performance can be limited by its design. However, there are some settings that you can use to improve it.
1. Move towards your Apex server panel and click FTP File Access in the top left corner.
2. Locate the server.properties file and press Edit to the right of that, then copy and paste these options into the file on new lines:view-distance=10 tick-distance=2 max-threads=0
Note - If you already have one or more of these settings, then modify the values as needed.
3. After that, click Save in the top and restart the server from your main panel.
The view distance determines how many chunks a player can see. This saves server resources. The tick distance controls how many chunks the player is able to see. This helps with resource usage. The max threads setting controls the maximum number of threads that the server can use. If set to 0, it will attempt to use all. These settings will optimize your Bedrock server and improve performance. If you continue to experience problems, it is a good idea to limit the activity in your world. To get better performance and enable Bedrock connections, you can also implement Geyser in a Paper server.
It is important to make sure your server is lag-free and optimized. Players don't expect to experience lag when they join a server. Although you cannot control the lag clients experience, there are many things you can do to avoid server-side lag.
You may believe that a Vanilla Minecraft server won't experience lag if it is running. It's the base version of Minecraft after all. The base game is slow and doesn't offer many optimization options. The game is now resource-hungry thanks to newer updates like 1.17+. Your performance will be greatly improved by switching to Paper or one its forks, such as Purpur or Airplane. This guide will help you switch to Paper and improve your performance. It will also keep your server lag free.