Articles on: Gaming Servers

How To Optimize Your Minecraft Server

When running a Minecraft server, optimizing performance is crucial for ensuring a smooth gaming experience. This article is for version 1.20. Some things may still apply to 1.15 - 1.19.

Note: For users that are on vanilla, Fabric or Spigot (or anything below Paper) - go to your server.properties and change sync-chunk-writes to false. This option is forcibly set to false on Paper and its forks, but on other server implementations you need to switch this to false manually. This allows the server to save chunks off the main thread, lessening the load on the main tick loop.

Fine-tuning your server settings is essential for optimizing performance to meet your specific needs. This article aims to help you understand which options affect performance and how they impact your server.

You can find the full in depth Minecraft server optimization guide here.

Server Jar



Your choice of server software can make a huge difference in performance and API possibilities. There are many viable popular server JARs.

By default, NameHero's Minecraft servers are installed with Paper Spigot. One of the best and most popular server jar files for performance. At NameHero we also give you the ability to change the Minecraft jar file to your preference. Listed below are the best jar versions we recommend:


Recommended Picks:

Paper - The most popular jar that aims to improve performance while fixing gameplay
Pufferfish - Paper fork that aims to further improve server performance.
Purpur - Pufferfish fork focused on features and customization.

Jars To Avoid:

Any paid server JAR that claims async anything - 99.99% chance of being a scam.
Bukkit/CraftBukkit/Spigot - Extremely outdated in terms of performance compared to other jars you have access to.
Any plugin/software that enables/disables/reloads plugins on runtime.
Many forks further downstream from Pufferfish or Purpur will encounter instability and other issues.

For all these next options, we will be modifying config files. Please make sure to save a backup of the original file before altering! Next up in this guide covers where you can find all the files we will be editing.


Where To Find Configuration Files



Step 1: Go to your NameHero Client Area and stop your Minecraft server.



Step 2: Head over to the Advanced Game Panel by clicking the blue button as seen in the screenshot above within the NameHero Client Area. Here you will be accessing the Files tab to locate the configuration files:



Step 3: There are a couple files we will be accessing to edit the configurations.

server.properties

paper-world-defaults

bukkit.yml

spigot.yml

**Server Properties**



Step 1: To find the server.properties file, scroll down towards the bottom of your files tab and you will see the server.properties file.



**Paper-world-defaults**



Step 1: To find the paper-world-defaults file**,** in your files tab navigate to the config folder.



Step 2: In the config folder, you will find the paper-world-defaults file.



Note: Clicking on these files in the Advanced Game Panel will allow you to edit them, you can also use sFTP to download / upload and edit your files.

Configurations



server.properties

network-compression-threshold

Good starting value: 256

This option allows you to set the threshold for packet compression. Increasing the threshold can reduce CPU usage at the expense of higher bandwidth usage, while setting it to -1 disables compression entirely. Be aware that a higher threshold may negatively affect clients with slower network connections. If your server operates within a local network or shares a machine with a proxy (with less than 2 ms ping), disabling compression (-1) is advantageous, as internal network speeds can typically manage the additional uncompressed traffic.


server.properties

simulation-distance

Good starting value: 4

Simulation distance is distance in chunks around the player that the server will tick. Essentially the distance from the player that things will happen. This includes furnaces smelting, crops and saplings growing, etc. This is an option you want to purposefully set low, somewhere around 3 or 4, because of the existence of view-distance. This allows to load more chunks without ticking them. This effectively allows players to see further without the same performance impact.

view-distance

Good starting value: 7

This is the distance in chunks that will be sent to players, similar to no-tick-view-distance from paper.

The total view distance will be equal to the greatest value between simulation-distance and view-distance. For example, if the simulation distance is set to 4, and the view distance is 12, the total distance sent to the client will be 12 chunks.

spigot.yml


view-distance

Good starting value: default

This value overwrites server.properties one if not set to default. You should keep it default to have both simulation and view distance in one place for easier management.


paper-world configuration


delay-chunk-unloads-by

Good starting value: 10s

This setting lets you control how long chunks remain loaded after a player leaves. It prevents chunks from being repeatedly loaded and unloaded as players move back and forth. However, setting it too high can cause an excessive number of chunks to stay loaded simultaneously. For areas frequently visited or teleported to, consider keeping those chunks permanently loaded. This approach is more efficient for your server than constantly reloading chunks.

max-auto-save-chunks-per-tick

Good starting value: 8

This setting allows you to slow down incremental world saving by distributing the task over a longer period, improving overall performance. For servers with more than 20-30 players, consider setting this higher than 8. If the incremental save process doesn't finish in time, Bukkit will automatically save any remaining chunks at once and then restart the process.

prevent-moving-into-unloaded-chunks

Good starting value: true

When enabled, prevents players from moving into unloaded chunks and causing sync loads that bog down the main thread causing lag. The probability of a player stumbling into an unloaded chunk is higher the lower your view-distance is.

entity-per-chunk-save-limit

Good starting values:



This option allows you to set limits on the number of specific entity types that can be saved. It is recommended to set a limit for each type of projectile to prevent server crashes caused by excessive projectiles being saved and loaded. You can find entity IDs on the Minecraft wiki and adjust the limits as needed. A suggested value for all projectiles is around 10. Additionally, you can add other entities by their type names to the list. Note that this configuration option is not intended to prevent players from creating large mob farms.


Mobs



bukkit.yml

spawn-limits

Good starting values:



The formula for limiting mobs is [playercount] * [limit], where "playercount" is the current number of players on the server. Naturally, the smaller these numbers, the fewer mobs will appear. The per-player-mob-spawn setting adds another limit to ensure mobs are evenly distributed among players. Lowering this value reduces server workload but can negatively impact gameplay modes that rely heavily on natural mob spawning. You can set it as low as 20 or less if you adjust the mob-spawn-range appropriately. Decreasing the mob-spawn-range will make it seem like there are more mobs around each player. If you are using Paper, you can configure mob limits per world in the paper-world configuration.

ticks-per

Good starting values:



This option determines how often (in ticks) the server attempts to spawn certain living entities. Water and ambient mobs do not need to spawn every tick since they are not typically killed quickly. For monsters, slightly increasing the interval between spawns should not affect spawn rates, even in mob farms. Generally, all values for this option should be higher than 1. Increasing this interval can also help your server manage areas where mob spawning is disabled.


spigot.yml


mob-spawn-range

Good starting value: 3

This setting enables you to decrease the range (in chunks) within which mobs spawn around the player. Depending on your server's game mode and the number of players, you may want to decrease this value in conjunction with the spawn-limits in bukkit.yml. Lowering this value creates the impression of more mobs nearby. It should be set lower than or equal to your simulation distance and should never exceed your hard despawn range / 16.

entity-activation-range

Good starting values:



You have the option to define the distance from the player at which an entity should be active and perform actions. Decreasing these values can improve server performance but might lead to unresponsive mobs until the player approaches them closely. However, reducing these values too much could disrupt certain mob farms, with iron farms being particularly susceptible.

entity-tracking-range

Good starting values:



This setting determines the distance in blocks from which entities will be visible, although they won't be sent to players. Setting this value too low can create the illusion of mobs suddenly appearing near a player. In most situations, this distance should exceed your entity-activation-range.

tick-inactive-villagers

Good starting value: false

This allows you to control whether villagers should be ticked outside of the activation range. This will make villagers proceed as normal and ignore the activation range. Disabling this will help performance, but might be confusing for players in certain situations. This may cause issues with iron farms and trade restocking.

nerf-spawner-mobs

Good starting value: true

You can make mobs spawned by a monster spawner have no AI. Nerfed mobs will do nothing. You can make them jump while in water by changing spawner-nerfed-mobs-should-jump to true in paper-world configuration.


paper-world configuration

despawn-ranges

Good starting values:



This feature allows you to customize entity despawn ranges in blocks. Lowering these values accelerates the removal of mobs that are distant from the player. It's advisable to maintain a soft range around 30 blocks and adjust the hard range slightly beyond your simulation distance. This prevents immediate despawning when a player moves just beyond the loaded chunk boundary, leveraging the delay-chunk-unloads-by setting in the paper-world configuration. Mobs outside the hard range will be instantly despawned, while those between the soft and hard ranges have a random chance of despawning. Ensure your hard range exceeds your soft range, and adjust it based on your view distance calculated as (simulation-distance * 16) + 8, accounting for partially unloaded chunks after a player visits them.

per-player-mob-spawns

Good starting value: true

This option decides if mob spawns should account for how many mobs are around target player already. You can bypass a lot of issues regarding mob spawns being inconsistent due to players creating farms that take up the entire mobcap. This will enable a more singleplayer-like spawning experience, allowing you to set lower spawn-limits. Enabling this does come with a very slight performance impact, however it's impact is overshadowed by the improvements in spawn-limits it allows.

max-entity-collisions

Good starting value: 2

Overwrites option with the same name in spigot.yml. It lets you decide how many collisions one entity can process at once. Value of 0 will cause inability to push other entities, including players. Value of 2 should be enough in most cases. It's worth noting that this will render maxEntityCramming gamerule useless if its value is over the value of this config option.

update-pathfinding-on-block-update

Good starting value: false

Disabling this will result in less pathfinding being done, increasing performance. In some cases this will cause mobs to appear more laggy; They will just passively update their path every 5 ticks (0.25 sec).

fix-climbing-bypassing-cramming-rule

Good starting value: true

Enabling this option resolves the issue where entities climbing would not be affected by cramming. It prevents excessive stacking of mobs in confined spaces, even if they are climbing, such as spiders.

armor-stands.tick

Good starting value: false

In most cases you can safely set this to false. If you're using armor stands or any plugins that modify their behavior and you experience issues, re-enable it. This will prevent armor stands from being pushed by water or being affected by gravity.

armor-stands.do-collision-entity-lookups

Good starting value: false

This disables armor stand collisions. This will help if you have a lot of armor stands and don't need them colliding with anything.

tick-rates

Good starting values:



This setting determines the frequency, in ticks, at which specified behaviors and sensors are activated. The "acquirepoi" behavior for villagers is particularly resource-intensive, so its interval has been significantly extended. If villagers encounter difficulties navigating their environment, consider reducing this interval.


Misc



spigot.yml

merge-radius

Good starting values:

item: 3.5

exp: 4.0

This decides the distance between the items and exp orbs to be merged, reducing the amount of items ticking on the ground. Setting this too high will lead to the illusion of items or exp orbs disappearing as they merge together. Setting this too high will break some farms, as well as allow items to teleport through blocks. There are no checks done to prevent items from merging through walls (unless Paper's fix-items-merging-through-walls setting is activated). Exp is only merged on creation.

hopper-transfer

Good starting value: 8

Time in ticks that hoppers will wait to move an item. Increasing this will help improve performance if there are a lot of hoppers on your server, but will break hopper-based clocks and possibly item sorting systems if set too high.

hopper-check

Good starting value: 8

Time in ticks between hoppers checking for an item above them or in the inventory above them. Increasing this will help performance if there are a lot of hoppers on your server but will break hopper-based clocks and item sorting systems relying on water streams.


paper-world configuration

alt-item-despawn-rate

Good starting values:



This list lets you set alternative time (in ticks) to despawn certain types of dropped items faster or slower than default. This option can be used instead of item clearing plugins along with merge-radius to improve performance.

redstone-implementation

Good starting value: ALTERNATE_CURRENT

Replaces the redstone system with faster and alternative versions that reduce redundant block updates, lowering the amount of logic your server has to calculate. Using a non-vanilla implementation may introduce minor inconsistencies with very technical redstone, but the performance gains far outweigh the possible issues. A non-vanilla implementation option may additionally fix other redstone inconsistencies caused by CraftBukkit.


The ALTERNATE_CURRENT implementation is based off of the Alternate Current mod. More information on this algorithm can be found on their resource page.

hopper.disable-move-event

Good starting value: false

InventoryMoveItemEvent doesn't work unless there is a plugin actively listening to that event. This means that you only should set this to true if you have such plugin(s) and don't care about them not being able to act on this event. Do not set to true if you want to use plugins that listen to this event, e.g. protection plugins!

hopper.ignore-occluding-blocks

Good starting value: true

Determines if hoppers will ignore containers inside full blocks, for example hopper minecart inside sand or gravel block. Keeping this enabled will break some contraptions depending on that behavior.

tick-rates.mob-spawner

Good starting value: 2

This option lets you configure how often spawners should be ticked. Higher values mean less lag if you have a lot of spawners, although if set too high (relative to your spawners delay) spawn rates will decrease.

optimize-explosions

Good starting value: true

Setting this to true replaces the vanilla explosion algorithm with an optimized one, at a cost of slight inaccuracy when calculating explosion damage. This is not noticeable.

treasure-maps.enabled

Good starting value: false

Generating treasure maps is extremely expensive and can hang a server if the structure it's trying to locate is in an ungenerated chunk. It's only safe to enable this if you pregenerated your world and set a world border.

tick-rates.grass-spread

Good starting value: 4

Time in ticks between the server trying to spread grass or mycelium. This will make it so large areas of dirt will take a little longer to turn to grass or mycelium. Setting this to around 4 should work nicely if you want to decrease it without the decreased spread rate being noticeable.

tick-rates.container-update

Good starting value: 1

Time in ticks between container updates. Increasing this might help if container updates cause issues for you (it rarely happens), but makes it easier for players to experience desync when interacting with inventories (ghost items).

non-player-arrow-despawn-rate

Good starting value: 20

Time in ticks after which arrows shot by mobs should disappear after hitting something. Players can't pick these up anyway, so you may as well set this to something like 20 (1 second).

creative-arrow-despawn-rate

Good starting value: 20

Time in ticks after which arrows shot by players in creative mode should disappear after hitting something. Players can't pick these up anyway, so you may as well set this to something like 20 (1 second).


Helpers



paper-world configuration

anti-xray.enabled

Good starting value: true

Enable this to hide ores from x-rayers. For detailed configuration of this feature check out Configuring Anti-Xray. Enabling this will actually decrease performance, however it is much more efficient than any anti-xray plugin. In most cases the performance impact will be negligible.

nether-ceiling-void-damage-height

Good starting value: 127

If this option is greater that 0, players above the set y level will be damaged as if they were in the void. This will prevent players from using the nether roof. Vanilla nether is 128 blocks tall, so you should probably set it to 127. If you modify the height of the nether in any way you should set this to [your_nether_height] - 1.


Not a NameHero customer yet? Elevate your gaming experience with one of our gaming servers today!

Learn More

Updated on: 11/10/2024

Was this article helpful?

Share your feedback

Cancel

Thank you!