PhoenixNodes
Search…
Optimizing your server

1. Use Paper

  • Paper is a high-performance fork of Spigot that adds extra features while also increasing server performance. You can find more information about it here.
  • Paper also tends to fix bugs that come out after initial releases of Spigot for the latest versions of Minecraft. A good example would be the 0-tick farm bug that existed for a long time, and for the people who didn't want 0-tick farms in specific to be patched, they added it as an option in the paper.yml config!
  • Paper has better API support for plugin developers, which means it has more support for plugin creators and more features that can be utilized in their plugins.
  • Another reason to get Paper is thanks to their asynchronous chunk loading and generation. This means fast traveling methods won't lag your server as hard and chunk loading becomes much faster in general!

2. Customize your server configurations

Now we will start with getting the server optimized manually. It's relatively easy to learn! We will start by configuring server.properties - Keep in mind that this guide only covers certain options, it's encouraged to take a look at everything and customize it to your liking!

server.properties

1
broadcast-rcon-to-ops=true
2
view-distance=8
3
max-build-height=256
4
server-ip=0.0.0.0
5
rcon.port=25575
6
level-seed=
7
allow-nether=true
8
gamemode=survival
9
enable-command-block=true
10
server-port=25565
11
enable-rcon=false
12
server-name=ExampleName
13
enable-query=false
14
op-permission-level=5
15
prevent-proxy-connections=false
16
generator-settings=
17
resource-pack=
18
player-idle-timeout=0
19
level-name=world
20
rcon.password=
21
motd=Example Server Message of the Day
22
query.port=25565
23
force-gamemode=false
24
debug=false
25
hardcore=false
26
white-list=false
27
broadcast-console-to-ops=true
28
pvp=true
29
spawn-npcs=true
30
spawn-animals=true
31
generate-structures=true
32
snooper-enabled=true
33
difficulty=hard
34
function-permission-level=2
35
network-compression-threshold=256
36
level-type=default
37
max-tick-time=60000
38
spawn-monsters=true
39
enforce-whitelist=false
40
max-players=100
41
use-native-transport=true
42
spawn-protection=0
43
resource-pack-sha1=
44
online-mode=true
45
allow-flight=false
46
max-world-size=29999984
Copied!
There are a lot of settings here, but we will only focus on the ones that matter the most for what type of server you plan on running.
view-distance is how far chunks will be loaded by players in your server. You will want this between 4 and 16, in multiples of two (I.E. 4, 6, 8, 10, 12, 14, 16). Too little and you won't be to see very far, too much and the server will have performance issues. This generally depends on how many players you plan on having in your server, and how much RAM you have.
  • View distances 12 - 16 would be best for around one to five players. Like a small group of friends, or a very small server.
  • View distances 8 - 10 are generally best for average sized servers (around ten or more players), although view-distance is set to 8 by default. It's usually best to keep view-distance set to 8.
  • View distances 4 and 6 are best for very small worlds, like minigames. This way you can have a lot of players in the same general area, without taking up too many server resources.
level-seed is what you'll want to set when using a custom seed for your server's world, keep in mind that you'll need to generate a new world in order for this setting to work.
motd is the text that shows up for your server in the in-game server list. You can make a custom MOTD with colors and formatting here.
difficulty can be set to peaceful, easy, normal, or hard. Keep in mind that hard is best if you plan on having villager farms, as any other difficulty gives a chance for villagers to permanently die, rather than be converted into zombie villagers.
max-players can be set to anything, like 9001, or 1337, or simply 100. This option is up to you, although it's best to set it according to how many players you expect to have.

spigot.yml

1
config-version: 12
2
settings:
3
log-villager-deaths: false
4
debug: false
5
sample-count: 12
6
player-shuffle: 0
7
user-cache-size: 1000
8
int-cache-limit: 1024
9
late-bind: false
10
item-dirty-ticks: 20
11
bungeecord: false
12
attribute:
13
maxHealth:
14
max: 2048.0
15
movementSpeed:
16
max: 2048.0
17
attackDamage:
18
max: 2048.0
19
netty-threads: 4
20
timeout-time: 60
21
restart-on-crash: false
22
restart-script: ./start.sh
23
filter-creative-items: true
24
moved-wrongly-threshold: 10
25
moved-too-quickly-multiplier: 10
26
save-user-cache-on-stop-only: false
27
commands:
28
send-namespaced: true
29
spam-exclusions:
30
- /skill
31
replace-commands:
32
- setblock
33
- summon
34
- testforblock
35
- tellraw
36
log: true
37
silent-commandblock-console: false
38
tab-complete: 0
39
messages:
40
restart: The server is restarting.
41
whitelist: You are not whitelisted.
42
unknown-command: Unknown command. Type "/help" for help.
43
server-full: The server is full!
44
outdated-client: Outdated client! Use version {0}
45
outdated-server: Outdated server! Currently using {0}
46
stats:
47
disable-saving: false
48
forced-stats: {}
49
advancements:
50
disable-saving: false
51
disabled:
52
- minecraft:story/disabled
53
world-settings:
54
default:
55
seed-endcity:
56
trident-despawn-rate: 900
57
view-distance: default
58
max-entity-collisions: 8
59
seed-desert:
60
seed-igloo:
61
seed-jungle:
62
seed-swamp:
63
seed-shipwreck:
64
seed-ocean:
65
seed-outpost:
66
verbose: false
67
item-despawn-rate: 24000
68
merge-radius:
69
item: 0
70
exp: 0
71
arrow-despawn-rate: 600
72
enable-zombie-pigmen-portal-spawns: true
73
wither-spawn-sound-radius: 0
74
hanging-tick-frequency: 100
75
entity-activation-range:
76
villagers: 32
77
flying-monsters: 32
78
villagers-work-immunity-after: 100
79
villagers-work-immunity-for: 20
80
villagers-active-for-panic: true
81
water: 16
82
raiders: 48
83
animals: 32
84
monsters: 32
85
misc: 16
86
tick-inactive-villagers: true
87
wake-up-inactive:
88
animals-max-per-tick: 4
89
animals-every: 1200
90
animals-for: 100
91
monsters-max-per-tick: 8
92
monsters-every: 400
93
monsters-for: 100
94
villagers-max-per-tick: 4
95
villagers-every: 600
96
villagers-for: 100
97
flying-monsters-max-per-tick: 8
98
flying-monsters-every: 200
99
flying-monsters-for: 100
100
random-light-updates: false
101
growth:
102
bamboo-modifier: 100
103
sweetberry-modifier: 100
104
kelp-modifier: 100
105
beetroot-modifier: 100
106
carrot-modifier: 100
107
potato-modifier: 100
108
cactus-modifier: 100
109
cane-modifier: 100
110
melon-modifier: 100
111
mushroom-modifier: 100
112
pumpkin-modifier: 100
113
sapling-modifier: 100
114
wheat-modifier: 100
115
netherwart-modifier: 100
116
vine-modifier: 100
117
cocoa-modifier: 100
118
mob-spawn-range: 4
119
ticks-per:
120
hopper-transfer: 8
121
hopper-check: 1
122
hopper-amount: 1
123
entity-tracking-range:
124
players: 48
125
animals: 48
126
monsters: 48
127
misc: 32
128
other: 64
129
save-structure-info: true
130
max-tnt-per-tick: 250
131
squid-spawn-range:
132
min: 45.0
133
hunger:
134
jump-walk-exhaustion: 0.05
135
jump-sprint-exhaustion: 0.1
136
combat-exhaustion: 0.1
137
regen-exhaustion: 2.5
138
swim-multiplier: 0.02
139
sprint-multiplier: 0.05
140
other-multiplier: 0.0
141
max-tick-time:
142
tile: 50
143
entity: 50
144
seed-village:
145
seed-feature:
146
seed-monument:
147
seed-slime:
148
dragon-death-sound-radius: 0
149
nerf-spawner-mobs: false
150
zombie-aggressive-towards-villager: true
151
worldeditregentempworld:
152
verbose: false
153
Copied!
Most stuff in spigot.yml are things you won't want to touch, but a few things that are useful are what's listed below. Listed here is a page explaining most of everything in spigot.yml
There are a few interesting things you can change, a few of them being:
  • merge-radius is the amount of space before dropped items (blocks, mob drops, etc.) will merge. Set these to 0.0 for a classic back-in-the-day Minecraft feel!
  • growth contains settings for growth modifiers for many different types of crops, you can change these individually to whatever values you like!
  • ticks-per and hopper-amount are great if your server contains mass autofarms with thousands of hoppers, boosting hopper speed and/or amount can help reduce the amount of lag your server gets. There is no need to change this if your server doesn't have these, but the effect is definitely noticeable.

paper.yml

1
verbose: false
2
config-version: 20
3
settings:
4
chunk-tasks-per-tick: 1000
5
enable-player-collisions: true
6
save-empty-scoreboard-teams: false
7
suggest-player-names-when-null-tab-completions: true
8
region-file-cache-size: 256
9
incoming-packet-spam-threshold: 300
10
use-alternative-luck-formula: false
11
use-versioned-world: false
12
bungee-online-mode: true
13
save-player-data: true
14
load-permissions-yml-before-plugins: true
15
watchdog:
16
early-warning-every: 5000
17
early-warning-delay: 10000
18
velocity-support:
19
enabled: false
20
online-mode: false
21
secret: ''
22
spam-limiter:
23
tab-spam-increment: 1
24
tab-spam-limit: 500
25
book-size:
26
page-max: 2560
27
total-multiplier: 0.98
28
async-chunks:
29
enable: true
30
threads: -1
31
timings:
32
enabled: true
33
verbose: true
34
server-name-privacy: false
35
hidden-config-entries:
36
- database
37
- settings.bungeecord-addresses
38
- settings.velocity-support.secret
39
history-interval: 300
40
history-length: 3600
41
server-name: ExampleServerName
42
messages:
43
no-permission: '&4You do not have permission to perform this command.'
44
kick:
45
authentication-servers-down: ''
46
flying-player: Flying is not allowed on this server.
47
flying-vehicle: Flying is not allowed on this server.
48
connection-throttle: Connection throttled! Please wait before reconnecting.
49
world-settings:
50
default:
51
light-queue-size: 20
52
zombie-villager-infection-chance: -1.0
53
iron-golems-can-spawn-in-air: false
54
phantoms-do-not-spawn-on-creative-players: true
55
phantoms-only-attack-insomniacs: true
56
seed-based-feature-search: true
57
portal-create-radius: 16
58
fix-zero-tick-instant-grow-farms: false
59
entities-target-with-follow-range: false
60
per-player-mob-spawns: false
61
keep-spawn-loaded-range: 8
62
keep-spawn-loaded: true
63
auto-save-interval: -1
64
armor-stands-do-collision-entity-lookups: true
65
disable-ice-and-snow: false
66
skeleton-horse-thunder-spawn-chance: 0.01
67
count-all-mobs-for-spawning: false
68
disable-thunder: false
69
nether-ceiling-void-damage-height: 0
70
allow-non-player-entities-on-scoreboards: false
71
disable-explosion-knockback: false
72
water-over-lava-flow-speed: 5
73
use-faster-eigencraft-redstone: true
74
parrots-are-unaffected-by-player-movement: true
75
container-update-tick-rate: 1
76
non-player-arrow-despawn-rate: -1
77
creative-arrow-despawn-rate: -1
78
prevent-tnt-from-moving-in-water: false
79
grass-spread-tick-rate: 1
80
bed-search-radius: 3
81
armor-stands-tick: false
82
spawner-nerfed-mobs-should-jump: false
83
allow-leashing-undead-horse: false
84
baby-zombie-movement-speed: 0.5
85
all-chunks-are-slime-chunks: false
86
mob-spawner-tick-rate: 1
87
disable-teleportation-suffocation-check: false
88
optimize-explosions: false
89
portal-search-radius: 128
90
fixed-chunk-inhabited-time: -1
91
enable-treasure-maps: true
92
treasure-maps-return-already-discovered: false
93
prevent-moving-into-unloaded-chunks: false
94
use-vanilla-world-scoreboard-name-coloring: false
95
max-auto-save-chunks-per-tick: 24
96
filter-nbt-data-from-spawn-eggs-and-related: true
97
max-entity-collisions: 8
98
disable-creeper-lingering-effect: false
99
duplicate-uuid-resolver: saferegen
100
duplicate-uuid-saferegen-delete-range: 32
101
remove-corrupt-tile-entities: false
102
experience-merge-max-value: -1
103
falling-block-height-nerf: 0
104
tnt-entity-height-nerf: 0
105
anti-xray:
106
enabled: true
107
engine-mode: 1
108
chunk-edge-mode: 2
109
max-chunk-section-index: 3
110
update-radius: 2
111
hidden-blocks:
112
- gold_ore
113
- iron_ore
114
- coal_ore
115
- lapis_ore
116
- mossy_cobblestone
117
- obsidian
118
- chest
119
- diamond_ore
120
- emerald_ore
121
- ender_chest
122
replacement-blocks:
123
- stone
124
game-mechanics:
125
nerf-pigmen-from-nether-portals: false
126
disable-pillager-patrols: false
127
disable-sprint-interruption-on-attack: false
128
disable-relative-projectile-velocity: false
129
shield-blocking-delay: 1
130
disable-chest-cat-detection: true
131
disable-player-crits: false
132
disable-end-credits: true
133
disable-unloaded-chunk-enderpearl-exploit: true
134
scan-for-legacy-ender-dragon: true
135
pillager-patrols:
136
spawn-chance: 0.2
137
spawn-delay:
138
per-player: false
139
ticks: 12000
140
start:
141
per-player: false
142
day: 5
143
squid-spawn-height:
144
maximum: 0.0
145
max-growth-height:
146
cactus: 3
147
reeds: 3
148
lightning-strike-distance-limit:
149
sound: -1
150
impact-sound: -1
151
flash: -1
152
hopper:
153
cooldown-when-full: true
154
disable-move-event: false
155
lootables:
156
auto-replenish: false
157
restrict-player-reloot: false
158
reset-seed-on-fill: true
159
max-refills: -1
160
refresh-min: 12h
161
refresh-max: 2d
162
fishing-time-range:
163
MinimumTicks: 100
164
MaximumTicks: 500
165
despawn-ranges:
166
soft: 32
167
hard: 128
168
frosted-ice:
169
enabled: true
170
delay:
171
min: 20
172
max: 40
173
alt-item-despawn-rate:
174
enabled: false
175
items:
176
COBBLESTONE: 300
177
generator-settings:
178
flat-bedrock: false
179
baby-zombie-movement-modifier: 0.5
180
viewdistances:
181
no-tick-view-distance: -1
182
Copied!
There are a lot of useful settings in here, feel free to check them out for yourself! Also make sure to customize plugins to your liking, as having everything utilized makes a server shine!

3. Lag management

If your server starts to lag, take a look at your plugins, make sure none of them are known to cause issues or have incompatibilities with your current version. Another very useful feature of Paper is timings. Doing /timings report in-game will generate a report that tells you what may be causing unneeded TPS (ticks-per-second) usage on your server. 20 TPS is perfect, 0 lag on your server. Anything less than that means something may be causing lag.
Also, contrary to popular belief, most "Clear Lag" plugins will not actually reduce lag by getting rid of dropped items. It's up to server owners to optimize and properly manage their server for lag not to happen. Dropped items generally do not cause TPS lag, but rather FPS (framerate) lag if there's too many of them.
Good examples of things that cause TPS lag are players loading new chunks, players traveling fast (elytra, boosted minecart, flying, etc.) mass autofarms, lag machines, noise machines, condensed mob farms, egg farms with too many chickens (too many mobs in one space, leading to TPS lag due to mob collisions and the chickens trying to pathfind), and things with many moving parts involving pistons, like large flying machines.
Bad examples of things that actually don't cause TPS lag but may be confused for it are things like many dropped items on the ground causing loss in framerate, minecarts, armor stands, and item frames causing framrate lag due to the amount of entities being rendered, fishing bobbers and boats, which some "lag clearing" plugins remove for some reason, arrows, and other things like that.