Minecraft Server Optimization

From Scientific Programs
Jump to: navigation, search

One of the biggest concerns for server owners is lag. Lag can occur for a variety reasons, whether your server has more resources or your server is running on outdated hardware. Luckily, if you host with Apex, hardware should not be an issue. There are many options to reduce the lag on your server.



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



These options are enough to make you wonder what causes lag. 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). TPS (Ticks per Second) is the equivalent of a heartbeat. Your server beats at a fixed rate of 20 ticks per second, so one tick every 0.05 seconds.



On each tick, various aspects of the server advance a little bit; Mobs move, grass grows, animals spawn, almost everything that happens on the server relies on ticks. You'll experience normal gameplay at peak performance (20 TPS), without any server-side lag. However, if your server's TPS begins to drop, you will begin to experience lag while playing.



What occurs on the server, as well as the hardware it is running on, plays an important role in determining the server's TPS. Inadequate hardware can lead to the same fate as mismanaging the server.



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 will mistakenly assume that the number of people on their server will be the only thing that determines their performance. The number of players on the server can have an effect, but this is relatively small compared to the impact of redstone machines, mob farms, and mods/plugins. The primary cause of TPS drops is a result of what you have going on in your world at a given time.



Client Lag (FPS)



A low FPS will usually mean that your game behaves slowly. A low frame rate can make it feel like you are watching a slideshow. Having a low frame rate on your server does not mean that the server is lagging but that your computer is failing to keep 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 know the difference between server lag and 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 many ways to increase FPS without having your hardware upgraded. You can reduce the functions of Minecraft by going to the video settings. You can also turn off clouds to save your computer from trying to render them. It is also a good practice to close any processes that are running in the background that you do not need. This allows your computer to use more resources for the game. This can be done quickly by closing any open Taskbar items.



Another option is switching to the high performing plan in your device’s energy options. Windows PC users can switch to the high-performance plan by pressing Windows Key + X. This will open a new context menu. Next, select "Power Options" and you will be able to access your settings. Change the Power mode to "Best Performance".



Connection Lag (Ping)



Connection lag correlates with your ping. Ping refers to the network latency between your game and your server. This is the time it takes for data to be processed and transported in milliseconds. If your ping is high, it's possible your connection may be lost. High ping isn't caused by lag. It could also cause the game's crash.



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. let's talk about games



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 you how long it takes the server to reply to a message. There are many ways to test your Ping, but 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 ping play.apexmc.co". The process may take a second to run, but you should see the average ping displayed once it is done.



Create a timings report



A timings report allows you to monitor how long it takes for your server to process an event. 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. You can click on it to open the report from your browser.



A timings report



The top section in the timings report will include a graph that displays your server's average time per second over time. This graph is shown in five-minute intervals. Below the graph is a brief overview of the server, with 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. To determine the cause of lag, you should look at the data under 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 begins with a general overview of the type tick occurring. The top tree in the list will often be a complete summary of the entire server's average ticks. These trees can be expanded by clicking on them to get more information for each layer. 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 will automatically sort information so that the processes that take longer to complete appear first. These items are often the cause of any lag you may be experiencing on the server. Going through the top trees on the list is the quickest way to identify the cause of your lag. Once you identify the cause, it is possible to go back to the server to remove it, or to modify your settings to reduce its effect.



It can be intimidating to read a timings summary report. You have a lot of great resources to help you understand the timings report if you get stuck. Your best option would be to contact our support team. All of our tech support agents have knowledge about timing reports and can analyze them for your benefit. They can also walk you through the process of reading a report if you are stuck.



How to fix a laggy Minecraft server



Knowing how to optimize your server is vital in preventing server lag. There are many tools that you can use to optimize your server and push it beyond its normal performance limits.



Tick/Lag machines removed



Redstone can be used to build almost any type of machine. But too many machines can lead to problems. It'll decrease your TPS, and cause lag for all players. This is why you need to limit the machines, and install anti-redstonelag plugins. You should limit the number of automated farms, mob grinding machines, and other devices that require complex redstone mechanics. If possible, you should include a way for your machines and farms to be turned off so they aren't running constantly and consuming your server resources.



Pre-generating your world



Pregenerating the world is a crucial step in lag removal. This should be done before you do anything else. The Chunky plugin is the best way to do it. To install the plugin, run the following commands. /chunky 5000 followed immediately by /chunky beginning.



This will pre-generate a radius of 5,000 blocks 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 as much as you like, but we recommend keeping it under 20,000 blocks. Any larger and you could possibly create more lag than you would be preventing.



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 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 offers excellent performance thanks to its optimization and anticheat features.



Optimizing your config files



Bukkit is one of the most important files you need to modify in order to optimize your server.

yml and Paper.yml. Below you'll find the settings you need to adjust to get the best performance with minimal 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 can be found in the FTP File Access tab of your control panel. You can access them online by clicking on "edit" at the top of the file. After editing is complete, click on the green button to save the file. The server will then be restarted to allow the changes to take place.



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. There are many plugins out there that aim to reduce lag. Once you are familiar with which ones to use you will find that lag can be significantly reduced on your server after installing one or two plugins. Here is a list with the top plugins that we recommend to our users.



ClearLagg (1.8+), Limit Pillagers (1.14.2+), Village Optimiser(1.14.2+), MergedMobs, Premium 1.7+), Entity Tracker Fixeder (1.14+), Farm Limiter, (Premium 1.7+), Mob Manager (Premium 1.7+), Mob Limiter, (Premium 1.7+), Mob Farm Manager, (Premium 1.7+), 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.



One of the most important aspects of owning a server is making sure it is well optimized and lag-free. When players join a server they don't expect that they will experience lag issues. 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 game. Unfortunately, the base version of the game doesn't provide many optimization options and can be slow. Newer updates like 1.17+ have made it more resource-hungry. Switching to Paper or one of its forks like Purpur or Airplane will drastically improve your performance. Following this guide after switching to Paper will further improve performance, keep your players happy, and keep your server lag-free.