Minecraft Server Optimization



One of the biggest concerns for server owners is lag. 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 options to reduce the lag on your server.



There are plugins to 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 several types of lag, including latency, TPS and FPS. In this guide, we will give a breakdown of the different types of lag and the best way to mitigate it on your Minecraft Server.



Types of lag



Server Lag (TPS)



TPS (Ticks Per Se) is the measure of server performance. TPS (Ticks per Second) is the equivalent of a heartbeat. Your server beats at 20 ticks per minute, or one tick every 0.05 seconds.



Each tick advances various aspects of your server a little. Mobs move grass grows, animals hatch, and almost everything else on the server is dependent on ticks. Normal gameplay will occur at 20 TPS if the server is performing at its maximum. However, if your server's TPS begins to drop, you will begin to experience lag while playing.



The server's environment and hardware play an important role in determining the servers TPS. Poor server management can be as damaging as inadequate hardware.



When you are adding plugins or mods to your site, it is important to consider the long-term impact of your choices. Many new server owners mistakenly assume that the server's performance is determined by the number of players. 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 caused by what is going on in your own world at the time.



Client Lag (FPS)



Having low FPS will generally come with your game behaving slowly. You may feel like you're watching a slideshow when your frame rate drops to a low level. 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. If your PC is experiencing a low framerate, you may need to adjust your game settings or update your drivers.



It is important to understand the difference between server lag or low FPS. Sometimes low FPS and high server lag can co-occur. While it may seem like the server is laging, it is often due to the device the game is being played on.



There are a lot of ways to fix low FPS without having to upgrade your hardware. You can change the video settings to reduce Minecraft's functions. For example, you can turn clouds off so that your computer doesn't have to try and 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. If you are on a Windows PC, you can do this by pressing the Windows Key + X to open a new context menu. Then choose "Power Options" to open up your settings. Change the Power mode to "Best Performance".



Connection Lag (Ping)



Your ping correlates with connection lag. Ping refers to the network latency between your game and your server. This is how long it takes data to travel and process. If you have high ping, it's possible that your connection to the server may timeout. 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. The ping of a server that is further from you than your physical location will usually increase. This can be minimized by moving your server to the closest location to you and your players. Some factors that might affect ping include Internet connection speed, the quality of a user's Internet service provider, issues with the Minecraft servers network, and the configuration of firewalls.



Latency can change depending upon network conditions and the status on the server to which it is connected. You can check the latency of a server by "pinging it". 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, you could type "ping play.apexmc.co". While the process may take some time, you will see the average Ping once it is complete.



How to create a timings reports



A timings report allows you to monitor how long it takes for your server to process an event. This allows you see where there may be lag issues, which can cause the server's TPS drops. To run a Timings Report, log on to your server. Run the command: /timings ON. After 30 minutes, type the command: /timings POST. This will give a link. Click it to open the report in a browser.



A timings report



The top section of the timings reports will contain a simple graph which shows your servers average TPS over time. It is displayed in five-minute intervals. The graph shows a brief overview of your server, along with the average TPS. These are a nice way to get an idea of your server's performance at a glance, but they won't tell you why your server is lagging. You will need to examine the data section below the graph to determine the root cause of the lag.



The lower portion of a timings report contains a complete breakdown (also called a "tree view") of every tick that occurred during the reporting process. Each tree starts as a broad overview of what type of tick is happening. The top tree of the list will often provide a summary for the entire server's average ticks. To expand these trees and see more information about each layer, you can click on them. Once you reach the end, you'll be able to see which block or entity is ticking. Also, how long it is taking.



A timings report by default will sort information so processes that take the longest time to tick appear first. These items are often responsible for any lag that you might be experiencing on the server. This is the fastest way to determine the cause of your lag. Once you've identified the cause of your lag, you can go back and delete it from your server or change your settings to minimize its impact.



It can be intimidating to read a timings summary report. If you get stuck, or if it is unclear how you are reading it, there are some great resources to help clarify any confusion. Your best option would be to contact our support team. All of our tech support agents are familiar with timings reports and can analyze them for you, or walk you through how to read a report if you are getting stuck.



How to fix a laggy Minecraft server



Server lag can often be avoided by knowing how to optimize your server. There are many tools to help you get the best performance out of your server. You can even push it beyond its current performance limits.



Tick/Lag machines removed



Redstone is a great mechanic for creating almost any type of machine. However, too many machines can create problems. It will decrease your TPS and cause lag to all players. The solution for this is to limit the machines and install anti-redstone-lag plugins like 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 a crucial step in lag removal. 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. The server will slow down while this process is running but it will soon be completed. Your performance will improve greatly once the process is complete. You can increase your radius as much or as little as you want, but we recommend keeping it below 20,000 blocks. You could create more lag than what you are trying to prevent by making it larger.



One option that is beneficial to reduce on any type of Minecraft server is the view distance from the server.properties file. Any number between 6-8 will optimize the server and not affect gameplay. To further improve server performance, it is recommended to change the view distance to 64 and the "Net Compression Threshold to 64".



We strongly recommend switching from Vanilla or Spigot to Paper. Paper has a large number of optimization and anti-cheat features to provide excellent performance.



Optimizing your config files



Some of the main files that you will want to modify to really optimize your server are Bukkit.

yml. Paper.yml. Spigot.yml. Below we have included which settings you will want to change to get the best performance possible with minimal effect on your gameplay.


To access these settings, first stop your server by going to your control panel. Next, click on the tabs to display the optimized settings. These files can also be found in your control panel's FTP File Access tab. You can open them in the online web editor by clicking on the "edit" button to the far right of the file.minecraft server list Once you're done editing make sure to click "Save", then restart the server to make the changes take effect.



Bukkit.yml



Spigot.yml



Paper.yml



Changing the base server files is not the only way to reduce or get rid of lag. There are many plugins out there that aim to reduce lag. You can reduce lag significantly on your server by knowing which plugins to use. Here's a list containing the plugins we recommend the most frequently 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+)



These plugins may not be able to stop all lag, but they can make a difference. If you do not know how to install plugins on your Minecraft server, We have an easy guide for you to follow.



Owning a server is an important aspect. When players join a server they don't expect that they will experience lag issues. While you can't always prevent the client-side lag, there are things you can do.



If you are running a Vanilla Minecraft server, you may think that it won't experience lag. It's the base version of Minecraft after all. Unfortunately, the base game doesn't offer a lot of options for optimization and can be really laggy as a result. Newer updates like 1.17+ have made it more resource-hungry. Your performance will be greatly improved by switching to Paper or one its forks, such as Purpur or Airplane. This guide after switching to Paper will improve performance, keep players happy, and keep the server lag free.