diff --git a/README.md b/README.md index 901906f..733647a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,227 @@ -# minecraft-optimization -Minecraft server optimization guide + +

Minecraft server optimization guide

+ +

Guide for version 1.16.4

+

Based on this guide and other sources (all of them are linked throughout the guide when relevant).

+ +

Intro

+

+To begin I'd like to mention that this is not some sort of "magical cure". +There are no guides that will tell you exactly what to do for your server. +This is meant to set you in the right direction of finding your server's "sweet spot".

+ +

Server jar

+

+Choice of server jar can make huge difference in performance and api possibilities. There are currently multiple viable popular server jars, +but there are also a few that you should stay away from for various reasons. +

+My recommendation is: + +You shoud stay away from: + + +

Map pregen

+

+Map pregeneration is one of the most important steps to have lag-free server. +In modern versions chunk generation is extremely slow and even servers on best +hardware can grind into a halt. You can use plugin such as chunky +to pregenerate the world. Remember to also set up a world border so your players don't generate new chunks while the server is open to the public! +Pregeneration of the map can take hours (it depends on a radius you set in the pregen plugin). +

+

+It's key to remember that overworld, nether and the end have separate world borders and you have to set it up for each world. +Remember that nether dimension is usually 8x smaller than overworld, because if you set worldborder wrong your players might end up +outside of world border! +

+ +

Configurations

+ +

server.properties

+ +

network-compression-threshold

+default: 256
+optimized: Standalone(512) BungeeCord(-1)
+explanation:
+This option caps the size of a packet before the server attempts to compress it. Setting it higher can save some +resources at the cost of bandwidth, setting it to -1 disables it. If your server is in a network with the proxy on +localhost or the same datacenter (<2 ms ping), disabling this (-1) will be beneficial. + +
+

bukkit.yml

+ +

spawn-limits

+default: monsters:70, animals:10, water-animals:15, ambient:15
+optimized: monsters:45, animals:8, water-animals:3, ambient:1
+explanation:
+Lower values mean less mobs. Less mobs is less lag in general, but you want to balance it with player quality of life, +finding mobs in the world is big part of gameplay. More detailed explanation of how limits are calculated can be found in this pdf. + +

chunk-gc.period-in-ticks

+default: 600
+optimized: 400
+explanation:
+This decides how often vacant chunks are unloaded. Ticking fewer chunks means less TPS consumption. + +

ticks-per.monster-spawns

+default: 1
+optimized: 4
+explanation:
+This sets how often (in ticks) the server attempts to spawn a monster. Slighty increasing the time between spawns should not impact spawn rates. + +
+

spigot.yml

+ +

max-tick-time

+default: tile:50, entity:50
+optimized: tile:1000, entity:1000
+explanation:
+Setting those to optimized values disables this feature. +You can read why it should be disabled here. + +

view-distance

+default: default
+optimized: 3
+explanation:
+Actual view distance should be set low due to the fact that less chunks will be ticked and paper's no-tick-view-distance +lets you send more chunks to player that are actually ticked. + +

mob-spawn-range

+default: 8
+optimized: 2
+explanation:
+This usually should be 1 less than view-distance. You can experiment with other values when changing bukkit mob caps. + +

entity-activation-range

+default: animals:32, monsters:32, raiders: 48, misc:16
+optimized: animals:16, monsters:24, raiders: 48, misc:8
+explanation:
+Entities past this range will be ticked less often. Avoid setting this too low or you might break mob behavior (mob aggro, raids, etc). + +

tick-inactive-villagers

+default: true
+optimized: false
+explanation:
+Enabling this prevents the server from ticking villagers outside the activation range. Villager tasks in 1.14+ are very heavy. + +

merge-radius

+default: item:2.5, exp:3.0
+optimized: item:3.0, exp:6.0
+explanation:
+This will decide the distance between the items to be merged, reducing the amount of items ticking on the ground. +Merging will lead to the illusion of items disappearing as they merge together. A minor annoyance. + +

nerf-spawner-mobs

+default: false
+optimized: true
+explanation:
+When enabled, mobs from spawners will not have AI (will not swim/attack/move). This is big TPS savings on servers with mob +farms, but also messes with their behavior. + +
+

paper.yml

+Most of the settings in this file can be configured per-world. See +this pdf for details. + +

max-auto-save-chunks-per-tick

+default: 24
+optimized: 8
+explanation:
+Slows down incremental world saving spreading the task over time even more for better average performance. You might want +to set this higher with more than 20-30 players, because if incremental save can't finish in time bukkit will automatically +save leftover chunks at once and begin the process again. + +

optimize-explosions

+default: false
+optimized: true
+explanation:
+Faster explosion alghoritm with no impact on gameplay. + +

max-entity-collisions

+default: 8
+optimized: 2
+explanation:
+Less collisions calculation per entity. + +

grass-spread-tick-rate

+default: 1
+optimized: 4
+explanation:
+Time in ticks before server tries to spread grass/mycelium. No gameplay impact in most cases. + +

despawn-ranges

+default: soft: 32, hard: 128
+optimized: soft: 28, hard: 48
+explanation:
+Lower ranges clear background mobs and allow more to be spawned in areas with player traffic. This further reduces the +gameplay impact of reduced spawning (bukkit.yml). Values adjusted for view-distance: 3. + +

hopper.disable-move-event

+default: false
+optimized: true
+explanation:
+This will significantly reduce hopper lag by preventing InventoryMoveItemEvent being called for EVERY slot in a container. +Do not enable if you use plugins that listen to this event! + +

non-player-arrow-despawn-rate

+default: -1
+optimized: 20
+explanation:
+Makes arrows shot by mobs disappear after 1 second after hitting. + +

creative-arrow-despawn-rate

+default: -1
+optimized: 20
+explanation:
+Makes arrows shot by players in creative disappear after 1 second after hitting. + +

prevent-moving-into-unloaded-chunks

+default: false
+optimized: true
+explanation:
+Prevents players from entering an unloaded chunk (due to lag), which causes more lag. The true setting will set them back +to a safe location instead. + +

use-faster-eigencraft-redstone

+default: false
+optimized: true
+explanation:
+Alternative, faster redstone system. Reduces redundant redstone updates by nearly 95%. + +

alt-item-despawn-rate.enabled

+default: false
+optimized: true
+explanation:
+This option lets you despawn selected items faster than default despawn rate. You can add things like cobblestone, netherrack +etc. to the list and make them despawn after ~20 seconds (400 ticks). + +

enable-treasure-maps

+default: true
+optimized: false
+explanation:
+Generating treasure maps is extremely expensive and can hang a server if the structure it's trying to locate is really +far away. + +

viewdistances.no-tick-view-distance

+default: -1
+optimized: 8
+explanation:
+This allows players to see further without ticking as many chunks as regular view-distance would. Although it's not really +heavy on the server keep in mind that sending more chunks will affect bandwidth. + +

anti-xray.enabled

+default: false
+optimized: true
+explanation:
+Hides ores from x-rayers. For detailed configuration of this feature check out +Stonar96's recommended settings. + +

Java startup flags

+JVM can be configured to reduce lag spikes caused by big garbage collector tasks. You can find +startup flags optimized for minecraft servers here.