Minecraft Server Optimization

From Camera Database
Revision as of 12:47, 31 August 2022 by Touchmarch5 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Lag is one of the most common concerns for server administrators. Lag can happen for many reasons. It could be due to the hardware or resources your server has. Apex hosts are hardware-free. There are many ways to reduce 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.



These options are enough to make you wonder what causes lag. There are several types possible of lag such as 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 Second) is an indicator of overall server performance. TPS is the server's heartbeat. Your server beats at a fixed rate, 20 ticks per second. That's one tick every 0.05 seconds.



Each tick is a small step in the progress of various server aspects. Mobs move, grass grows and animals spawn. Almost everything that happens on the server depends upon ticks. Normal gameplay will occur at 20 TPS if the server is performing at its maximum. If your server's TPS starts dropping, you'll notice lag during play.



What occurs on the server, as well as the hardware it is running on, plays an important role in determining the server's TPS. Poor server management can be as damaging as inadequate hardware. minecraft server hosting



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 caused by what is going on in your own world at the time.



Client Lag (FPS)



A low FPS will usually mean that your game behaves slowly. If your frame rate is low enough, playing the game may feel like watching a slideshow. Low frame rates do not indicate that your server is slowing down. However, it could mean that your computer cannot keep up with your 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 server lag can occur simultaneously. You may think that low FPS is due server 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 reduce the functions of Minecraft by going to the video settings. For example, you can turn clouds off so that your computer doesn't have to try and render them. It is also a good practice to close any processes that are running in the background that you do not need. This will free up resources for the game. You can do this quickly by closing anything that's open on your Taskbar.



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. 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 is the latency in the network 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 isn't caused by lag. It can also cause a crash in the game.



Having a low ping is best as lower latency provides 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 upon network conditions and the status on the server to which it is connected. You can "ping" a server to see how latency it will have. This tells you how long it takes the server to reply to a message. There are several methods to test your ping. We recommend using the 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". The process may take a second to run, but you should see the average ping displayed once it is done.



How to create a timings reports



A timings report lets you monitor the time it takes for your server's event to process. This report allows you to spot potential lag issues and causes the server TPS drop. To run a timer report, connect to your server and use the command /timings off. After 30 minutes, run /timings past. This will give a link. Click it to open the report in a 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. To determine the cause of lag, you should look at the data under the graph.



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 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. These trees can be expanded by clicking on them to get more information for each layer. As you get to the end of each layer, you can see which block is ticking and how much time it takes.



By default, a timings report will sort information so that processes that take the longest to tick appear first. These items are often what causes any lag on the server. 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.



Reading a timings report can be a little intimidating at first. If you get stuck, or if it is unclear how you are reading it, there are some great resources to help clarify any confusion. Contact our support team for the best solution. Our tech support agents are well-versed in timings reports and can assist you with any questions.



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 fantastic mechanic that can be used to create almost any type or machine. But, too many machines can cause 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. Avoid automated farms, mob grinders, and any other device that involves complex redstone mechanics. It is a good idea to include a way to turn off your farms and machines, so they don't run all the time and consume your server resources.



Pre-generating your world



Pregenerating the universe is an essential step in lag reduction. This should be done before anything else. The Chunky plugin is the best way to do it. Install the plugin and then run the following commands: "/chunky radius 5500 followed by "/chunky begin".



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. minecraft server hosting You can increase or decrease the radius to your liking, but we recommend limiting it to 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 could optimize the server without affecting 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 strongly recommend that you switch to Paper if your current Spigot or Vanilla is running. 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 and Paper.yml. Below is a list of settings that you can change to get maximum performance with minimal effect on gameplay.

To use these settings, you need to stop your server in your control panel. Then click on the tabs that appear below to see the optimized settings. These files can be found in the FTP File Access tab of your control panel. These files can be opened in the online editor by clicking the "edit" button located at the bottom 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



Modifying the base server files isn't the only way to reduce lag. There are many plugins available created for the sole purpose of reducing 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 of the plugins we recommend most often 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 will not stop all lag on your server. However, they can be a big help. 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. Players don't expect to experience lag when they join a server. 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 is the base version of the game 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 after switching to Paper will improve performance, keep players happy, and keep the server lag free.