Articles on: Minecraft Guides

How to Improve Minecraft Server Performance

Improving your Minecraft Server Performance



Looking for Minecraft hosting? Browse our available options! https://tempest.net/game-server!

This guide is meant to help you improve your server performance, for the best results we would recommend checking your server
performance using Spark plugin and configuring these settings to your needs.

Step 1 - Using High-Performance Server Software




Using Spigot or Bukkit builds in production is not recommended, as these builds are meant for development and testing purposes
and are not optimized for production use.
We would recommend using PaperMC or Purpur as it is the most optimized server software for Minecraft.

Step 2 - Updating Server Startup Flags




We would recommend applying these flags to your server startup script, these flags will improve server performance and stability.
Keep in mind that these JVM flags will reduce your server memory usage by 20% to increase JVM heap memory.
This step is highly recommended for large minecraft servers.

For 1.18.2 and above:
-XX:MaxRAMPercentage=80.0 --add-modules=jdk.incubator.vector -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20

For 1.17.1 and below:
-XX:MaxRAMPercentage=80.0 -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20



Step 3 - Adjusting Server Configuration



This guide is an example and we highly recommend adjusting these settings to your needs.

server.properties


• Go to File Manager and find a file called server.properties



view-distance

This depends on player count, if your server has less than 5 online players, we would recommend setting this to 7-8,
If your server has more than 5 online players, we would recommend setting this to 5-6.

simulation-distance

This setting should be always lower than view-distance
What is simulation distance? Simulation distance is a view distance but for entities.
This setting could be more demanding than view distance. This is why we recommend setting it to 4-5

We are done for server.properties configuration, of course there is more settings that you can adjust depending on your needs.

bukkit.yml

• Go to File Manager and find a file called bukkit.yml



spawn-limits

This setting is used to define how many of each entity can spawn in the world.
We would recommend reducing this since some entities like ambient (bats) do not need as high of a count as these defaults.

spawn-limits:

monsters: 20
animals: 10
water-animals: 3
water-ambient: 5
water-underground-creature: 3
axolotls: 3
ambient: 7

ticks-per

This setting controls entity spawning rate, for example monster-spawns has a default value of 1, setting it to 2 will spawn monsters 2x slower
We would recommend setting everything twice much as the default setting.


ticks-per:

animal-spawns: 400
monster-spawns: 2
water-spawns: 2
water-ambient-spawns: 2
water-underground-creature-spawns: 2
axolotl-spawns: 2
ambient-spawns: 2
autosave: 8000


spigot.yml

Now lets move on to spigot.yml configuration, this file is located in the same directory as bukkit.yml



save-user-cache-on-stop-only

This setting prevents player data from being saved constantly, while setting this to true will improve server performance, but it will also increase the chance of player data loss if the server crashes.

merge-radius

This setting controls how close items need to be to merge together, we would recommend setting this to 4.0 for items and 5.0 for exp.


merge-radius:

item: 4.0
exp: 5.0


item-despawn-rate

This setting controls how long items will stay on the ground before despawning the default value is 6000, we would recommend setting this to 3000.

item-despawn-rate: 6000
arrow-despawn-rate: 500


nerf-spawner-mobs

This setting disables spawner mobs AI, in some cases this will drastically improve server performance.


nerf-spawner-mobs: true


entity-activation-range

This setting controls how far away entities need to be to be activated, we would recommend setting this to 24 for monsters and 24 for animals.


entity-activation-range:

animals: 24
monsters: 24
raiders: 32
misc: 16
water: 16
villagers: 24
flying-monsters: 32


tick-inactive-villagers

This setting controls if villagers should tick if there is no player near it. We would highly recommend setting this to false.


tick-inactive-villagers: false


entity-tracking-range

This setting controls how far away entities need to be tracked by the server, we would recommend leaving 48 for players and setting 32 for animals and monsters, 32 for misc, 96 for display and 48 for other.

entity-tracking-range:

players: 48
animals: 32
monsters: 32
misc: 32
display: 96
other: 48


paper-world-defaults.yml

Now lets move on to paper-world-defaults.yml configuration, this file is located in /config directory.





anti-xray

Anti-xray prevents players from seeing ores through walls, this setting is resource demanding and would recommend enabling if needed.


anticheat:
anti-xray:
enabled: true

max-auto-save-chunks-per-tick

This setting controls how many chunks can be saved per tick, we would recommend setting this to 8 to avoid large lag spikes.


max-auto-save-chunks-per-tick: 8


prevent-moving-into-unloaded-chunks

This setting prevents players from moving into unloaded chunks, this setting prevents players from getting stuck or forcing server to load a chunk while its overloaded.
We would recommend enabling it.

prevent-moving-into-unloaded-chunks: true


fix-climbing-bypassing-cramming-rule

This setting prevents players from bypassing cramming rule by using a ladder, vine, etc. we would recommend enabling this.

fix-climbing-bypassing-cramming-rule: true


armor-stands.tick

This setting controls if armor stands should tick, while it almost has no impact to vanilla gameplay, it could allow attacker to crash your server by spawning lots of armor stands.
This is why we recommend setting this to false.


entities:
armor-stands:
do-collision-entity-lookups: true
tick: false


alt-item-despawn-rate

This setting controls how long defined items should stay on ground before despawning, we would recommend setting to these optimized values.


spawning:

all-chunks-are-slime-chunks: false
alt-item-despawn-rate:
enabled: true
items:
acacia_leaves: 200
andesite: 200
bamboo: 500
birch_leaves: 200
cactus: 500
cobblestone: 200
dark_oak_leaves: 200
diorite: 200
dirt: 200
granite: 200
grass: 200
gravel: 200
jungle_leaves: 200
kelp: 500
mangrove_leaves: 200
melon_slice: 500
netherrack: 200
oak_leaves: 200
pumpkin: 200
red_sand: 200
sand: 200
scaffolding: 200
spruce_leaves: 200
sugar_cane: 500
twisting_vines: 200
weeping_vines: 200


despawn-ranges

This setting controls how far away entities need to be from a player to be despawned, we would recommend setting to these optimized values.


despawn-ranges:
ambient:
hard: 56
soft: 32
axolotls:
hard: 56
soft: 32
creature:
hard: 56
soft: 32
misc:
hard: 56
soft: 32
monster:
hard: 56
soft: 32
underground_water_creature:
hard: 56
soft: 32
water_ambient:
hard: 56
soft: 32
water_creature:
hard: 56
soft: 32


environment.optimize-explosions

This setting instructs server to cache entity lookups during an explosion, rather than recalculating throughout the process.
This speeds up explosions significantly.


environment:
optimize-explosions: true


tick-rates

This setting controls how often should certain events happen, we would recommend setting to these optimized values.
We would recommend not increasing container-update value as this can lead to desync issues.


tick-rates:
behavior:
villager:
validatenearbypoi: -1
container-update: 1
grass-spread: 3
mob-spawner: 2


### Conclusion


This guide shoud've helped you improve your server performance and stability, it should also eliminate most of the "anti-lag" plugins.
If you have any questions, feel free to contact us on our Discord server.

Updated on: 15/05/2023

Was this article helpful?

Share your feedback

Cancel

Thank you!