Minecraft Server Optimization

From Morphomics
Jump to: navigation, search

Server owners have a number of concerns, including 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 things you can do to reduce lag.



There are plugins to reduce lag. You can upgrade your server RAM, switch to a more optimized Minecraft jar, optimize your files, etc.



All of these options may leave you wondering what causes lag and how to get rid of it. There are a few different types of lag that can occur such as TPS, Latency, and FPS lag. 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)



Overall server performance is represented by its TPS (Ticks Per Second). A server's TPS is like a heartbeat. Your server beats at a fixed rate of 20 ticks per second, so 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. However, if your server's TPS begins to drop, you will begin to experience lag while playing.



The server's hardware and what happens on it play a crucial role in determining the server’s total server performance score (TPS). Poor server management can be as damaging as inadequate hardware.



When adding mods and plugins to your website, it is important that you consider the long-term implications 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)



A low FPS is generally indicative of a game that behaves slowly. You may feel like you're watching a slideshow when your frame rate drops to a low level. Low frame rates on your server do not necessarily indicate that the server has stopped responding to your requests. It could simply mean that your computer is not able to keep up with the game. If you experience a low framerate on your computer, it is likely that you need to adjust the game settings, update your drivers, or replace your graphics card, RAM or CPU.



It is important to know the difference between server lag and low FPS. Low FPS can sometimes appear simultaneously with server lag. While you may believe that the FPS is due the server's lag, it is often a separate problem with the device running the game.



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 frees up resources your computer can use for the game. You can quickly do this by closing all open Taskbar tabs.



Another option is switching to the high performing plan in your device’s energy options. Windows PC users can do this by pressing Windows Key + X. To open your settings, choose "Power Options". Change the Power Mode setting to "Best Performance". Server Stat



Connection Lag (Ping)



Your ping is related to your connection lag. Ping is the latency in the network between your game and your server. This is how long it takes data to travel and process. It is possible for your connection to the server not to work if you have high ping. High ping is not a sign of lag. It can cause lag. It can also cause a crash in the game.



Low latency is better for smoother gameplay. The ping of a server that is further from you than your physical location will usually increase. Moving your server to a location that is close to you and your users is the best way to reduce this. 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 on network conditions and the status of the server to which you're connecting. You can check the latency of a server by "pinging it". This tells the server how long it takes to receive a message from you and reply. There are a few ways to test your 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". It may take a while for the process to complete, but once it is over you should see the average number of pings.



How to create a timings reports



You can monitor the time taken by your server to process an event using a timings report. This allows you see where there may be lag issues, which can cause the server's TPS drops. To run a timer report, connect to your server and use the command /timings off. After 30 minutes, run /timings past. This will give you a link. You can click on it to open the report from 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. To the left of the graph is a brief summary of the server, including the average TPS. These are a great way to see how your server is performing, but they don't tell you what's causing it. To diagnose the cause of lag you will want to focus on the data in the section beneath the graph.



The lower section in a timings reporting is a detailed breakdown, also known as a tree view, of every tick that occurred while it was running. 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. Click on these trees to expand and view more information about each layer. As you get to the end of each layer, you can see which block is ticking and how much time it takes.



A timings reports will defaultly sort information so that processes taking the longest time to complete appear first. These items are often the root cause of any server lag. 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 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. 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 is preventable by learning how to optimize your servers. 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 fantastic mechanic that can be used to create almost any type or machine. However, having too many machines will cause problems to arise. It will cause lag for all players and decrease your TPS. This can be solved by limiting the machines and installing anti-redstone lag plugins such as this one. Otherwise, try not to have too many automated farms, mob grinders, or anything else that would involve complex redstone mechanics. Whenever possible you should also include a method to turn off your machines and farms so they are not running all the time and eating up 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 can be done using the Chunky plugin. To install the plugin, run the following commands. /chunky 5000 followed immediately by /chunky beginning.



This will pre-generate a 5,000 block radius around your world spawn. While the process is being run, the server may lag a bit but performance will improve significantly once it is finished. You can increase the radius however much you wish, but we recommend that it not exceed 20,000 blocks. If you make it larger, you might cause more lag than you intend to prevent.



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 should help with optimizing the server without being detrimental to gameplay. To further improve server performance, it is recommended to change the view distance to 64 and the "Net Compression Threshold to 64".



If you are running Spigot or Vanilla, we strongly recommend switching to Paper. Paper provides outstanding performance because it has many optimization and anti cheat features.



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.

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 can also be found in your control panel's FTP File Access tab. You can open these files in the online web editor by clicking the "edit button" to the right of the file. 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



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 is a list of the plugins we recommend most often to our users.



ClearLagg (1.14+), Limit Pillagers (1).14+), Village Optimiser 1.14.2+, MergedMobs 1.7+, Entity Tracker fixer (1.14+), Farm limiter (Premium 1.7+), Mob farm manager (Premium 1.7+), Spark 1.8+), StackMob (1.7+), Armor Stand Limiter 1.8+).



Although these plugins won't stop all lag from your server, they can help. If you do not know how to install plugins on your Minecraft server, We have an easy guide for you to follow.



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. It is impossible to control the lag that clients experience on client-side. However, there are some things you can do to reduce server-side lag.



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. The base game is slow and doesn't offer many optimization options. The game has become resource-hungry with newer updates, such as 1.17+. Switching to Paper or one of its forks like Purpur or Airplane will drastically improve your performance. This guide will help you switch to Paper and improve your performance. It will also keep your players happy and your server lag-free.