Reducing Lag

Reducing Lag
11 ArticlesOptimizing spigot.yml To Reduce Lag
If you’re running a Spigot server, you have a handful of options you can use to optimize your server to ensure optimal performance. This guide will show you the settings offered by Spigot that you can take advantage of to optimize your server’s performance. ::ProseNote{title="Note" description="This article is specifically for Minecraft Java Edition servers, and depends on Spigot or Paper to work." appearance="default"} :: Below is a list of settings from the and their recommended values for optimal performance in the order of most impact to least impact on performance. For help editing this file, reference our guide on modifying your Spigot configuration. For more detailed and advanced options you can adjust, feel free to check out this useful server optimization GitHub guide by YouHaveTrouble and contributors. | Option | Description | Default | Optimized / Recommended | |--------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------|--------------------------| | save-user-cache-on-stop-only | Prevents constant saving of user data while online. Improves performance, but may risk data loss if the server crashes. Make backups and stop the server regularly. | false | true | | entity-activation-range | Controls how close entities must be to players to activate AI. | animals: 16<brmonsters: 24<brraiders: 48<brmisc: 8 | (same as default) | | merge-radius | Increases how close items/XP must be to merge, reducing ticking entities. Too high values may cause bugs (e.g. teleporting through blocks). | item: 4.0<brexp: 6.0 | (same as default) | | nerf-spawner-mobs | Disables AI for mobs from spawners, improving performance on spawner-heavy servers. | false | true | | max-tick-time | Controls max tick time before skipping logic. Setting it to 1000 disables the feature to avoid breaking gameplay. | tile: 50<brentity: 50 | 1000 (disabled) | | mob-spawn-range | Sets how far (in chunks) from a player mobs can spawn. Keep lower than view distance to ensure effectiveness. | 8 | 6 | | arrow-despawn-rate | Controls how long survival arrows stay before despawning. Reduces entity lag. (300 ticks = 15s) | 1200 | 300 | | item-despawn-rate | Sets how long items stay on the ground before despawning. Reducing helps performance but may annoy players. (4000 ticks = 3.3 minutes) | 6000 | 4000 | | tick-inactive-villagers | Prevents ticking of villagers outside activation range. Greatly improves performance in 1.14+ servers. | true | false | You can further improve performance on your Spigot server by optimizing Bukkit and Paper. Learn more about how to optimize your Bukkit configuration with our guide on optimizing Bukkit’s bukkit.yml here.
How to Use Plugins to Reduce Lag on your Minecraft Server
Some Spigot plugins aim to optimize strenuous tasks or features on your Minecraft server to improve performance. That being said, you should generally be wary of plugins that claim to be “Anti-Lag” plugins. Plugins that claim to improve performance, but don't explain how, tend to do more harm than good in terms of server performance. If you are unsure of how to install plugins into your server, feel free to review on guide on the topic available here. --- Plugins that Help with Lag Here is a short list of plugins we recommend you consider when looking to improve your server's performance. ClearLagg - This Plugin is an all-in-one lag reducer, with many features to reduce server lag. Things like culling entities, limiting mob-spawning, limiting mob-eggs, setting per-item entity life-time, and more. We highly recommend using this plugin to help tune many common lag sources. Chunk Spawner Limiter - Using this plugin, you can limit how many entities can exist in a chunk. Although you can already do this using Paper configuration, this plugin offers much more flexibility and customization options. Chunky - This Plugin allows you to pre-generate chunks prior to players joining your server. This will help reduce lag since chunks will not need to be both loaded and generated in real-time by multiple players at the same time. StackMob - This Plugin allows you to stack entities on your server, without breaking Mob Spawners. This is a great plugin to install if you have entity lag problems due to player mob farms. Using this plugin, monsters of the same type near each other will stack into one "stacked" monster sharing the same AI. If you continue to experience lag issues with plugins installed to mitigate it, you can find our all-purpose lag guide here.
How to Take a Timings Report on your Minecraft Server
A timings report is a diagnostic tool on Spigot, Paper and SpongeForge servers that provides a detailed breakdown of server performance. It is often used to diagnose where server lag is coming from and is an extremely useful tool for managing your server. For many, it can be challenging to read timings reports. This is perfectly normal – at a first glance, it can appear to just be a sea of numbers and colours. Don’t worry; we’re always on hand to provide assistance so please get in touch if you’re stuck. ::ProseNote{title="OP Permissions" description="You must have Operator (OP) permissions to create a timings report, click here to learn how to become an OP." appearance="default"} :: How to Take a Timings Report in Spigot/Paper You can take a timings report by using the command when connected to your Spigot or Paper server. 1. Connect to your Server 2. When experiencing the performance issues on your server, enter the command . 3. You will see a message appear in the chat – after this message appears, wait for at least ten minutes. The timings report is being taken in the background! 4. After around 10-15 minutes, issue the command . 5. A link will appear in the chat – this is your timings report! --- How to Take a Timings Report in SpongeForge You can take a timings report by using the command when connected to your SpongeForge server. 1. Connect to your server. 2. As soon as you are experiencing performance issues on your server, issue the command . 3. Wait at least 10 minutes before issuing the command . Waiting for 10 minutes gives us the most accurate representation of where your server isn't performing so well. 4. You will then see a link appear - this is your timings report! --- Analyze your Timings report To learn how to analyze a timings report, please follow this tutorial: How to Analyze any Timings Report
How to Switch Your Minecraft Server to PaperMC/PaperSpigot
Switching your instance to PaperMC is one of the best choices when optimizing to get the most performance out of your Minecraft server. The PaperMC project was started to implement many improvements and optimizations to Spigot. It implements many new config options, API improvements, and scripts to enhance a server's performance. --- Creating a New Instance You can simply set up a new Minecraft instance in your control panel. This keeps your old server files while allowing you to start fresh and switch between instances easily. 1. Access your Control Panel and Stop your server. 2. Navigate to Instances. 3. Click Create New to make a new Instance. 4. Navigate through the Instance setup wizard by selecting Paper server type, desired version and a name & description. Once done, click Finish. 5. Set the active instance by clicking Switch. 6. Restart your server. --- Updating an Existing Instance If you wish to keep your current server files but switch over to a Paper server, you can edit an existing instance in your server control panel. 1. Access your Control Panel and Stop your server. 2. Select Edit Server Type. 3. Click on the Paper server type and click Next Step. 4. Select a version and then click on Next Step. 5. Click on Finish and then Restart your server. 6. Updating the Nether and End If you have progress in the Nether and End dimensions, they will need to be converted to the new server type. We have a guide on this process here. --- If you require any further assistance, please contact our support at: https://shockbyte.com/billing/submitticket.php
How To Reduce Lag On A Forge Server
Forge is one of the most used server types for running a modded Minecraft server. Unlike other popular Minecraft server types, PaperMC and Spigot, Forge does not come with any optimizations to the Vanilla server. That being said, there are some mods that you can install on your Forge server to improve performance. Each of these mods focuses on tweaking different areas of the server to improve performance. ::ProseNote{title="Please Note" description="These mods may not be compatible with the mods already installed on your server. We recommend you generate a backup before installing any additional mods to an existing server. Should you run into any issues after installing one of these mods, we recommend that you remove it." appearance="danger"} :: Optimization Mods If you are unsure of how to install mods onto your Forge server, feel free to refer to our knowledgebase article on the matter here. Performant - Performant focuses on optimizing a handful of different parts of a server. It provides optimizations for AI/Entities as well as block and chunk ticks. AI Improvements - AI Improvements focuses on optimizing the AI of mobs and non-living entities in the game. Usage can provide a 50% to 80% decrease in CPU usage caused by the AI. Dynamic View - Dynamic View is a utility mod that will dynamically adjust the view distance on your server. When the server is lagging, this mod will reduce view and simulation distances to remedy server strain. Once the lag subsides, the mod will return the distances to their configured values. FerriteCore - FerriteCore attempts to reduce overall memory usage. Using it can reduce memory usage by up to 45%. Starlight - Starlight is a mod similar to Phosphor, but instead of simply optimizing the lighting engine, it was completely rewritten. Due to this, it is incompatible with Phosphor. FoamFix - FoamFix focuses on reducing memory usage and improving the TPS of the server. Both of which can be very helpful, as modded servers are much more resource-intensive. ServerCore - ServerCore is a mod that optimizes the overall Minecraft server. This includes optimizations to entities, mob spawning, and chunk ticking. Phosphor - Phosphor optimizes the server's lighting engine, which decreases the time taken to generate or load chunks, helping to reduce overall stuttering when traversing the world. When using these mods, you can expect a big boost in your server's performance.
How To Reduce Lag On A FabricMC Server
Unlike SpigotMC and PaperMC, FabricMC does not come with any optimizations to the Vanilla server to improve server performance. FabricMC is just the mod layer for your server, similar to how Bukkit is just the plugin layer that Spigot and Paper build off of. That being said, there are some mods you can install on your Fabric server to improve performance. Each of these mods focuses on tweaking different parts of the server to improve overall performance. ::ProseNote{title="Please Note" description="These mods may not be compatible with the mods already installed on your server. We recommend you generate a backup before installing any additional mods to an existing server. Should you run into any issues after installing one of these mods, we recommend that you remove it." appearance="danger"} :: Optimization Mods If you are unsure of how to install mods onto your Fabric server, please refer to our guide on the topic here. Lithium - Lithium targets optimizing tick processes and mob behaviours, improving AIs, and changing data structures within the server to be more optimized, which can lead to an average of 45% improvement in server TPS. Phosphor - Phosphor optimizes the server's lighting engine, which decreases the time taken to generate or load chunks, helping to reduce overall stuttering when traversing the world. FerriteCore - FerriteCore attempts to reduce overall memory usage. Using it can reduce memory usage by up to 45%. Starlight - Starlight is a mod similar to Phosphor, but instead of simply optimizing the lighting engine, it was completely rewritten. Due to this, it is incompatible with Phosphor. ServerCore - ServerCore is a mod that optimizes the overall Minecraft server. This includes optimizations to entities, mob spawning, and chunk ticking. Hydrogen - Hydrogen focuses on reducing memory usage and improving the TPS of the server. Both of these can be very helpful as modded servers are much more resource-intensive. When using a combination of these mods, or all of them, you should expect to see a big improvement in server performance.
How to Reduce Entity Lag on a Minecraft Server
Entities play a large role in Minecraft gameplay, but they are known for causing lag on servers, regardless of their type. Entity lag occurs when a large number of entities gather in a relatively small space. If left unattended, this abundance of entities can adversely impact server performance and potentially result in chunk corruption. ::ProseNote{title="Please Note" description="This guide only covers unmodded Minecraft Java Edition servers." appearance="default"} :: What are Entities? In Minecraft, an entity refers to any object that can move, interact with players, store values, or have a non-cuboid shape. When troubleshooting entity lag, it's important to know the difference between the two main types of entities: regular entities and tile entities. --- Tile Entities vs Normal Entities Regular entities are generally living, humanoid, or simply an item on the ground. Some examples include mobs, items, projectiles, vehicles, and falling blocks. On the other hand, a tile entity is a simplified entity bound to a physical block placed in the world with unique associated data. Some examples of tile entities include a chest's inventory, redstone's power level, or a furnace's smelting logic. Normal entities tend to cause more lag due to their mobility, involving additional physics like gravity, collisions, and AI. Tile entities, being static blocks, have fewer features and lower lag potential. As a result, a single hopper minecart (Normal entity) can have a greater impact on entity lag than a row of hoppers (Tile entities). --- Reducing Entities to Lessen Entity Lag Removing excess entities is the simplest and most effective way to reduce entity lag on your server. This can easily be done using a plugin or mod that can automatically handle a large number of entities for you. There are some ways to manually remove entities in Vanilla, although they are far less precise and cannot be automated easily. You can determine if your server is experiencing entity lag by generating and reviewing a Spark report by following this guide. Using Plugins If your Minecraft server uses a server type capable of running plugins like Spigot, Paper, or Purpur, you will have a variety of public plugins available capable of remedying entity lag. ClearLagg - ClearLagg is a great option for helping entity lag, as it has many automated tools specializing in just that. Most notably, ClearLagg will remove configured entities on a schedule. For example, you could configure it to remove all dropped items and hostile monsters every 10 minutes. StackMob - StackMob is a great option for servers experiencing a lot of normal entity lag. StackMob will automatically stack configured mobs of the same type nearby each other into one single entity. This reduces the number of entities the server has to keep track of, improving performance issues caused by entities. Without Plugins If you aren't running a server that can use plugins, like Vanilla, you can remove entities by using some vanilla commands. You can use these vanilla commands to set up your own custom scheduled task. - Executing this command will only delete dropped items. - Replace REGISTRY\NAME with the registry name for the entity you wish to delete. You can schedule multiple instances of this task to delete hostile mobs. - Executing this command will delete every entity except players. If you are still experiencing entity lag on your server, we recommend taking a Spark report to identify problematic entities or other potential sources of lag.