From 0b90af411beaea405c6e7ccee1c0388eba58221b Mon Sep 17 00:00:00 2001 From: YouHaveTrouble Date: Tue, 23 Feb 2021 18:37:06 +0100 Subject: [PATCH 01/12] will this work? --- README.md | 276 +++++------------------------------------------------- 1 file changed, 25 insertions(+), 251 deletions(-) diff --git a/README.md b/README.md index a63f33e..bdd72b0 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,17 @@ # Minecraft server optimization guide -Guide for version 1.16.5 +Guide for version 1.16.5 + +WARNING: This version of the guide has experimental layout that is not yet complete! Based on [this guide](https://www.spigotmc.org/threads/guide-server-optimization%E2%9A%A1.283181/) and other sources (all of them are linked throughout the guide when relevant). ## Intro There will never be a guide that you can follow and it will give you perfect results. Each server has their own needs and limits on how much you can or you are willing to sacrifice. Tinkering around with the options to fine tune them to your servers needs it's what it's all about. This guide only aims to help you understand what options have impact on performance and what exactly they change. If you think you found inaccurate information within the guide you're free to open github issue telling me about it or open a pull request. +# Preparations + ## Server jar Your choice of server software can make a 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. @@ -29,274 +33,44 @@ It's key to remember that the overworld, nether and the end have separate world **Make sure to set up a vanilla world border (`/worldborder set [radius]`), as it limits certain functionalities such as lookup range for treasure maps that can cause lag spikes.** -## Configurations +# Configurations -### server.properties +## Networking -#### 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, and setting it to -1 disables it. If your server is in a network with the proxy on the same machine or datacenter (with less than 2 ms ping), disabling this (-1) will be beneficial. +### Network-compression-threshold +There is an option in `server.properties` file, called `network-compression-threshold`. This allows you to set the cap for the size of a packet before the server attempts to compress it. Setting it higher can save some resources at the cost of bandwidth, and setting it to -1 disables it. If your server is in a network with the proxy or on the same machine (with less than 2 ms ping), disabling this (-1) will be beneficial, as usually internal network speeds can handle the additional uncompressed traffic. --- -### bukkit.yml +## Chunks -#### spawn-limits -**default:** -monsters: 70, animals: 10, water-animals: 15, water-ambient: 20, ambient: 15 -**optimized:** -monsters: 12, animals: 5, water-animals: 2, water-ambient: 2, ambient: 0 -**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. With [per-player-mob-spawns](#per-player-mob-spawns) those numbers represent basically 1:1 limit of mobs in the given category per player, so mob cap math is `playercount*limit` where "playercount" is current amount of players on the server. +### view-distance +View-distance is distance in chunks around the player that server will tick. Essentially the distance from player that things will happen. This includes mobs being active, crops and saplings growing, etc. You should set this value in `spigot.yml`, as it overwrites the one from `server.properties` and can be set per-world. This option you want to purposefully set low, around `3` or `4`, because of the existance of `no-tick-view-distance`. -#### chunk-gc.period-in-ticks -**default:** 600 -**optimized:** 400 -**explanation:** -This decides how often vacant chunks are unloaded. Smaller the value means less chunks being ticked, but going too low will stress your CPU more. +### no-tick-view-distance +This option is added in `paper.yml` and allows you to set the maximum distance in chunks that players will see. This enables you to have lower `view-distance` and still let players see further. It's important to know that while the chunks beyond actual `view-distance` won't tick, they will still load from your storage, so don't go overboard. `10` is basically maximum of what you should set this to. As of now chunks are sent to the client regardless of their view distance setting, so going on higher values for this option can cause issues for players with slower connection. -#### ticks-per -**default:** -monster-spawn: 1, animal-spawns: 400, water-spawns: 1, ambient-spawns: 1, water-ambient-spawns: 1 -**optimized:** -monster-spawn: 10, animal-spawns: 400, water-spawns: 40, ambient-spawns: 40, water-ambient-spawns: 40 -**explanation:** -This sets how often (in ticks) the server attempts to spawn certain living entities. Water/ambient mobs do not need to spawn each tick as they don't usually get killed that quickly. As for monsters: Slightly increasing the time between spawns should not impact spawn rates even in mob farms. +### chunk-gc +`spigot.yml` lest you configure how often unused chunks should be unloaded. `peroid-in-ticks` is time in ticks between the unloads. The default value for this is `600`, however going as low as `400` is recommended, so you reduce the amount of ticking chunks. --- -### spigot.yml +## Mobs -#### max-tick-time -**default:** -tile: 50, entity: 50 -**optimized:** -tile: 1000, entity: 1000 -**explanation:** -Setting these to the recommended values disables this feature. You can read why it should be disabled [here](https://aikar.co/2015/10/08/spigot-tick-limiter-dont-use-max-tick-time/). [SOG] +### per-player-mob-spawns +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 entire mobcap. if you change `per-player-mob-spawns` to `true` in `paper.yml`. This will also make the job easier to properly set entity limits, as it makes the math easier. -#### view-distance -**default:** default -**optimized:** 3 -**explanation:** -Setting the actual view distance lower than default will make less chunks tick, and with paper's no-tick-view-distance enabled you will be able to send more chunks to player that actually tick. If you encounter issues with optimized value you can bump it to 4 and still get decent performance. +### spawn-limits +Located in `bukkit.yml`. When `per-player-mob-spawns` is enabled the math limiting mobs is just `playercount*limit`, where "playercount" is current amount of players on the server. Logically, smaller the numbers are, less mobs you're gonna see. Reducing this is a double-edged sword, as yes, your server has less work to do, but in some gamemodes natural mobs are big part of a gameplay. You can go as low as 20 or less if you adjust `mob-sapwn-range` properly. -#### mob-spawn-range -**default:** 8 -**optimized:** 2 -**explanation:** -Some people may argue that setting this to 1 less than [view-distance](#view-distance) is good enough, but lower values like 2 or 3 will allow you to decrease amount of mobs in [spawn-limits](#spawn-limits). +### mob-spawn-range +`spigot.yml` offers an option to reduce the range (in chunks) of where mobs will spawn around the player. Depending on your server's gamemode and its playercount you might want to reduce this value along with `bukkit.yml`'s `spawn-limits`. -#### 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). [SOG] - -#### 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. [SOG] - -#### 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. - -#### nerf-spawner-mobs -**default:** false -**optimized:** true -**explanation:** -When enabled, mobs from spawners will not have AI (will not swim/attack/move). This is a big TPS saver on servers with mob farms, but also messes with their behavior. [SOG] +### entity-tracking-range +Option available in `spigot.yml`. This is distance in blocks from which entities will be visible. Reducing those ranges only saves bandwidth, as entities are still ticked above this range. They just won't be sent to players. If set too low this can cause mobs seem to appear out of nowhere near a player. --- -### paper.yml -Most of the settings in this file can be configured per-world. See [this pdf](https://www.spigotmc.org/attachments/per-world-guide-pdf.444348/) for details. - -#### max-auto-save-chunks-per-tick -**default:** 24 -**optimized:** 8 -**explanation:** -Slows down incremental world saving by spreading the task over time even more for better average performance. You might want to set this higher with more than 20-30 players; if incremental save can't finish in time then bukkit will automatically save leftover chunks at once and begin the process again. - -#### per-player-mob-spawns -**default:** false -**optimized:** true -**explanation:** -By default mob limits are counted for the entire server which means mobs might end up being distributed unevenly between online players. This option enables per-player mob limits, meaning all players can get approximately the same number of mobs around them regardless of number of online players. Enabling this option also allows you to lower default `spawn-limits` in `bukkit.yml` since those are optimized for per-server mob limits. - -#### optimize-explosions -**default:** false -**optimized:** true -**explanation:** -Faster explosion algorithm with no noticeable impact on gameplay. [SOG] - -#### max-entity-collisions -**default:** 8 -**optimized:** 2 -**explanation:** -Limits the amount of collisions one entity will calculate at the same time. Setting this to optimized value will let you keep the player ability to nudge mobs. Setting this to 0 will completely disable collisions making nudging mobs/players impossible. - -#### 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. [SOG] - -#### despawn-ranges -**default:** -soft: 32, hard: 128 -**optimized:** -soft: 28, hard: 52 -**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](#bukkit.yml)). Values adjusted for [view-distance: 3](#view-distance). - -#### hopper.disable-move-event -**default:** false -**optimized:** true -**explanation:** -`InventoryMoveItemEvent` doesn't fire 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 use plugins that listen to this event, e.g. protection plugins!** - -#### non-player-arrow-despawn-rate -**default:** -1 -**optimized:** 20 -**explanation:** -Makes arrows shot by mobs disappear after 1 second after hitting something. - -#### creative-arrow-despawn-rate -**default:** -1 -**optimized:** 20 -**explanation:** -Makes arrows shot by players in creative disappear after 1 second after hitting something. - -#### prevent-moving-into-unloaded-chunks -**default:** false -**optimized:** true -**explanation:** -Prevents players from entering an unloaded chunk (due to lag), which causes more lag. Setting this to true will set them back to a safe location instead. [SOG] - -#### use-faster-eigencraft-redstone -**default:** false -**optimized:** true -**explanation:** -Alternative, faster redstone system. Reduces redundant redstone updates by nearly 95%. [SOG] - -#### 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). [SOG] - -#### 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 outside of your pregenerated world. It's only safe to enable this if you pregenerated your world and set a vanilla world border. - -#### treasure-maps-return-already-discovered -**default:** false -**optimized:** true -**explanation:** -Default value forces the newly generated maps to look for unexplored structure, which are usually outside of your pregenerated terrain. Setting this to true makes it so maps can lead to the structures that were discovered earlier. - -#### 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. - -#### entity-per-chunk-save-limit -**default:** -1 -**optimized:** -``` -entity-per-chunk-save-limit: - arrow: 8 - dragonfireball: 8 - egg: 8 - ender_pearl: 8 - fireball: 8 - firework: 8 - largefireball: 8 - lingeringpotion: 8 - llamaspit: 8 - shulkerbullet: 8 - sizedfireball: 8 - snowball: 8 - spectralarrow: 8 - splashpotion: 8 - thrownexpbottle: 8 - trident: 8 - witherskull: 8 -``` -**explanation:** -Limits the amount of projectiles that can be saved in a chunk. This prevents issues that arise with lower view-distance like players throwing massive amounts of snowballs into unloaded chunk that has a potential to crash your server on loading of that chunk. - -#### 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](https://gist.github.com/stonar96/ba18568bd91e5afd590e8038d14e245e). - ---- - -### purpur.yml -Only applicable for purpur. - -#### tps-catchup -**default:** true -**optimized:** false -**explanation:** -TPS catchup sends your server into overdrive after tps drops. If your server is constantly running more than 50mspt you'll most likely see an improvement in performance due to the fact that the server will not try to average the tps to 20 by going over 20. It's worth noting that some plugins may not expect this feature being disabled. - -#### use-alternate-keepalive -**default:** false -**optimized:** true -**explanation:** -Alternate system for keepalive packets so players with bad connection don't get timed out as often. - -#### dont-send-useless-entity-packets -**default:** false -**optimized:** true -**explanation:** -Prevent the server from sending empty position change packets (by default server sends move packet for each entity even if the entity hasn't moved) - -#### gameplay-mechanics.player.teleport-if-outside-border -**default:** false -**optimized:** true -**explanation:** -Teleport the player to the world spawn if they happen to be outside of the world border. Helpful since the vanilla world border is bypassable and the damage it does to the player can be mitigated. - -#### gameplay-mechanics.player.entities-can-use-portals -**default:** true -**optimized:** false -**explanation:** -Disables portal usage of all entities besides the player. This potentially fixes a dupe* and prevents entities changing worlds loading chunks on main thread. - -\* *more sources needed.* - -#### mobs.dolphin.disable-treasure-searching -**default:** false -**optimized:** true -**explanation:** -Prevents dolphins from performing structure search similiar to treasure maps ([`enable-treasure-maps`](#enable-treasure-maps)). - -#### mobs.zombie.aggressive-towards-villager-when-lagging -**default:** true -**optimized:** false -**explanation:** -Zombies stop targetting villagers when tps is under lag treshold. This saves the server precious time of calculating paths for zombies that are not targetting players. - ## Java startup flags [Paper and its forks in upcoming version 1.17 will require Java 11 (LTS) or higher](https://papermc.io/forums/t/java-11-mc-1-17-and-paper/5615). Good 2021 resolution to finally update your version of Java! (or at least inform your host so they can handle the migration). From 95445b71cbb570bd4a2fd3bba5e3286e2b785740 Mon Sep 17 00:00:00 2001 From: YouHaveTrouble Date: Wed, 24 Feb 2021 03:08:59 +0100 Subject: [PATCH 02/12] rewrote most of the guide --- README.md | 120 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 104 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index bdd72b0..2da411c 100644 --- a/README.md +++ b/README.md @@ -37,37 +37,126 @@ It's key to remember that the overworld, nether and the end have separate world ## Networking -### Network-compression-threshold -There is an option in `server.properties` file, called `network-compression-threshold`. This allows you to set the cap for the size of a packet before the server attempts to compress it. Setting it higher can save some resources at the cost of bandwidth, and setting it to -1 disables it. If your server is in a network with the proxy or on the same machine (with less than 2 ms ping), disabling this (-1) will be beneficial, as usually internal network speeds can handle the additional uncompressed traffic. +### Network-compression-threshold (`server.properties`) +This allows you to set the cap for the size of a packet before the server attempts to compress it. Setting it higher can save some resources at the cost of bandwidth, and setting it to -1 disables it. If your server is in a network with the proxy or on the same machine (with less than 2 ms ping), disabling this (-1) will be beneficial, as usually internal network speeds can handle the additional uncompressed traffic. + +### use-alternate-keepalive (`purpur.yml`) +you can enable alternate keepalive system, so players with bad connection don't get timed out as often. Has known incompatibility with TCPShield. --- ## Chunks -### view-distance +### view-distance (`spigot.yml`) View-distance is distance in chunks around the player that server will tick. Essentially the distance from player that things will happen. This includes mobs being active, crops and saplings growing, etc. You should set this value in `spigot.yml`, as it overwrites the one from `server.properties` and can be set per-world. This option you want to purposefully set low, around `3` or `4`, because of the existance of `no-tick-view-distance`. -### no-tick-view-distance -This option is added in `paper.yml` and allows you to set the maximum distance in chunks that players will see. This enables you to have lower `view-distance` and still let players see further. It's important to know that while the chunks beyond actual `view-distance` won't tick, they will still load from your storage, so don't go overboard. `10` is basically maximum of what you should set this to. As of now chunks are sent to the client regardless of their view distance setting, so going on higher values for this option can cause issues for players with slower connection. +### no-tick-view-distance (`paper.yml`) +This option allows you to set the maximum distance in chunks that players will see. This enables you to have lower `view-distance` and still let players see further. It's important to know that while the chunks beyond actual `view-distance` won't tick, they will still load from your storage, so don't go overboard. `10` is basically maximum of what you should set this to. As of now chunks are sent to the client regardless of their view distance setting, so going on higher values for this option can cause issues for players with slower connection. -### chunk-gc -`spigot.yml` lest you configure how often unused chunks should be unloaded. `peroid-in-ticks` is time in ticks between the unloads. The default value for this is `600`, however going as low as `400` is recommended, so you reduce the amount of ticking chunks. +### delay-chunk-unloads-by (`paper.yml`) +Lets you configure for how long chunks will stay loaded after player leaves. This helps to not constantly load and unload the same chunks when player moves back and forward. Too high values can result in way too many chunks being loaded at once. +### max-auto-save-chunks-per-tick (`paper.yml`) +Lets you slow down incremental world saving by spreading the task over time even more for better average performance. You might want to set this higher than `8` with more than 20-30 players. If incremental save can't finish in time then bukkit will automatically save leftover chunks at once and begin the process again. + +### prevent-moving-into-unloaded-chunks (`paper.yml`) +When enabled, prevents players from moving into unloaded chunks and causing sync loads that bog down the main thread causing lag. The probablility of player stumbling into unloaded chunk is higher the lower your view-distance is. + +### entity-per-chunk-save-limit (`paper.yml`) +With the help of this entry you can set limits to how many entities of specified type can be saved. You should provide a limit for each projectile at least to avoid issues with massive amounts of projectiles being saved and your server crashing on loading that. There is an list of all projectiles provided below. Please adjust the limit to your liking. Suggested value for all projectiles is around `10`. You can also add other entities by their type names to that list. +``` +entity-per-chunk-save-limit: + arrow: -1 + dragonfireball: -1 + egg: -1 + ender_pearl: -1 + fireball: -1 + firework: -1 + largefireball: -1 + lingeringpotion: -1 + llamaspit: -1 + shulkerbullet: -1 + sizedfireball: -1 + snowball: -1 + spectralarrow: -1 + splashpotion: -1 + thrownexpbottle: -1 + trident: -1 + witherskull: -1 +``` --- ## Mobs -### per-player-mob-spawns -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 entire mobcap. if you change `per-player-mob-spawns` to `true` in `paper.yml`. This will also make the job easier to properly set entity limits, as it makes the math easier. +### per-player-mob-spawns (`paper.yml`) +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 entire mobcap. if you change it to `true`. This will also make the job easier to properly set entity limits, as it makes the math easier. -### spawn-limits -Located in `bukkit.yml`. When `per-player-mob-spawns` is enabled the math limiting mobs is just `playercount*limit`, where "playercount" is current amount of players on the server. Logically, smaller the numbers are, less mobs you're gonna see. Reducing this is a double-edged sword, as yes, your server has less work to do, but in some gamemodes natural mobs are big part of a gameplay. You can go as low as 20 or less if you adjust `mob-sapwn-range` properly. +### spawn-limits (`bukkit.yml`) +When `per-player-mob-spawns` is enabled the math limiting mobs is just `playercount*limit`, where "playercount" is current amount of players on the server. Logically, smaller the numbers are, less mobs you're gonna see. Reducing this is a double-edged sword, as yes, your server has less work to do, but in some gamemodes natural mobs are big part of a gameplay. You can go as low as 20 or less if you adjust `mob-spawn-range` properly. If you are using tuinity, you can set mob limits per world in `tuinity.yml`. -### mob-spawn-range -`spigot.yml` offers an option to reduce the range (in chunks) of where mobs will spawn around the player. Depending on your server's gamemode and its playercount you might want to reduce this value along with `bukkit.yml`'s `spawn-limits`. +### mob-spawn-range (`spigot.yml`) +Allows you to reduce the range (in chunks) of where mobs will spawn around the player. Depending on your server's gamemode and its playercount you might want to reduce this value along with `bukkit.yml`'s `spawn-limits`. -### entity-tracking-range -Option available in `spigot.yml`. This is distance in blocks from which entities will be visible. Reducing those ranges only saves bandwidth, as entities are still ticked above this range. They just won't be sent to players. If set too low this can cause mobs seem to appear out of nowhere near a player. +### ticks-per (`bukkit.yml`) +This option sets how often (in ticks) the server attempts to spawn certain living entities. Water/ambient mobs do not need to spawn each tick as they don't usually get killed that quickly. As for monsters: Slightly increasing the time between spawns should not impact spawn rates even in mob farms. In most cases all of the values under this option should be higher than `1`. + +### entity-activation-range (`spigot.yml`) +You can set what distance from the player an entity should be for it to tick (do stuff). Reducing those values helps performance, but may result in irresponsive mobs until player gets really close to them. + +### entity-tracking-range (`spigot.yml`) +This is distance in blocks from which entities will be visible. Reducing those ranges only saves bandwidth, as entities are still ticked above this range. They just won't be sent to players. If set too low this can cause mobs seem to appear out of nowhere near a player. + +### despawn-ranges (`paper.yml`) +Lets you adjust entity despawn ranges (in blocks). Lower those values to clear the mobs that are far away from player faster. You should keep soft range around `30` and adjust hard range to a bit more than your actual view-distance, so mobs don't immediately despawn when player goes just beyond the point of chunk being loaded (this works well because of `delay-chunk-unloads-by` in `paper.yml`). + +### tick-inactive-villagers (`spigot.yml`) +This allows you to decide if villagers should be ticked outside of activation range. This will make villagers proceed as normal and ignore activation range. Disabling this will help performance, but might be confusing for players in certain situations. + +### nerf-spawner-mobs (`spigot.yml`) +You can make mobs spawned by 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.yml`. + +### max-entity-collisions (`paper.yml`) +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 inablity to push other entities, including players. Value of `2` should be enough in most cases. + +### dont-send-useless-entity-packets (`purpur.yml`) +Enabling this option will save you bandwidth by preventing the server from sending empty position change packets (by default server sends this packet for each entity even if the entity hasn't moved). May cause some issues with plugins that use client-side entities. + +### aggressive-towards-villager-when-lagging (`purpur.yml`) +Enabling this will cause zombies to stop targeting villagers if server is below tps treshold set in `lagging-threshold` in `purpur.yml`. + +--- + +## Misc + +### merge-radius (`spigot.yml`) +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. + +### alt-item-despawn-rate (`paper.yml`) +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 gain performance. + +### use-faster-eigencraft-redstone (`paper.yml`) +When endabled, the redstone system is replaced by a faster, alternative version that reduces redundant block updates reducing the amount of work your server has to do. + +### disable-move-event (`paper.yml`) +`InventoryMoveItemEvent` doesn't fire 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!** + +### optimize-explosions (`paper.yml`) +Setting this to `true` replaces vanilla explosion algorithm to a faster one, at a cost of slight inaccuracy when calculating explosion damage. This is usually not noticeable. + +### enable-treasure-maps (`paper.yml`) +Generating treasure maps is extremely expensive and can hang a server if the structure it's trying to locate is outside of your pregenerated world. It's only safe to enable this if you pregenerated your world and set a vanilla world border. + +### treasure-maps-return-already-discovered (`paper.yml`) +Default value of this option forces the newly generated maps to look for unexplored structure, which are usually outside of your pregenerated terrain. Setting this to true makes it so maps can lead to the structures that were discovered earlier. + +### disable-treasure-searching (`purpur.yml`) +Prevents dolphins from performing structure search similiar to treasure maps + +### teleport-if-outside-border (`purpur.yml`) +Allows you to teleport player to the world spawn if they happen to be outside of the world border. Helpful since the vanilla world border is bypassable and the damage it does to the player can be mitigated. + +### entities-can-use-portals (`purpur.yml`) +This option can disable portal usage of all entities besides the player. This prevents entities changing worlds loading chunks on main thread. --- @@ -92,7 +181,6 @@ Anything that enables or disables plugins on runtime is extremely dangerous. Loa ### mspt Paper offers a `/mspt` command that will tell you how much time server took to calculate recent ticks. If the first and second value you see are lower than 50, then congratulations! Your server is not lagging! If the third value is over 50 then it means there was at least 1 tick that took longer. That's completely normal and happens from time to time, so don't panic. - ### timings Great way to see what might be going on when your server is lagging are timings. Timings is a tool that lets you see exactly what tasks are taking the longest. It's the most basic troubleshooting tool and if you ask for help regarding lag you will most likely be asked for your timings. From af20144a559ed63a3a625ede7bd59d6a2475e37e Mon Sep 17 00:00:00 2001 From: YouHaveTrouble Date: Sat, 27 Feb 2021 21:54:58 +0100 Subject: [PATCH 03/12] things I missed before and should probably be here --- README.md | 45 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2da411c..8513854 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,13 @@ entity-per-chunk-save-limit: trident: -1 witherskull: -1 ``` + +### armor-stands-tick +In most cases you can safely set this to `false`. If you're using any plugins that modify the behavior or use armor stands and you experience issues with them you shouldn't change this one. + +### armor-stands-do-collision-entity-lookups +Here you can disable armor stand collisions. This will help if you have a lot of armor stands and don't need them colliding with anything. + --- ## Mobs @@ -118,12 +125,27 @@ You can make mobs spawned by monster spawner have no AI. Nerfed mobs will do not ### max-entity-collisions (`paper.yml`) 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 inablity to push other entities, including players. Value of `2` should be enough in most cases. +### update-pathfinding-on-block-update (`paper.yml`) +Disabling this will result in less pathfinding being done, increasing performance, but mobs can appear more laggy, as they will just passively update their path every 5 ticks (0.25 sec). + +### fix-climbing-bypassing-cramming-rule (`paper.yml`) +Enabling this will fix entities not being affected by cramming while climbing. This will prevent absurd amounts of mobs being stacked in small spaces even if they're climbing (spiders). + ### dont-send-useless-entity-packets (`purpur.yml`) Enabling this option will save you bandwidth by preventing the server from sending empty position change packets (by default server sends this packet for each entity even if the entity hasn't moved). May cause some issues with plugins that use client-side entities. ### aggressive-towards-villager-when-lagging (`purpur.yml`) Enabling this will cause zombies to stop targeting villagers if server is below tps treshold set in `lagging-threshold` in `purpur.yml`. +### entities-can-use-portals (`purpur.yml`) +This option can disable portal usage of all entities besides the player. This prevents entities changing worlds loading chunks on main thread. + +### villager.brain-ticks (`purpur.yml`) +This option allows you to set how often (in ticks) villager brains (work and poi) will tick. Going higher than `3` is confirmed to make villagers inconsistant/buggy. + +### villager.lobotomize (`purpur.yml`) +Lobotomized villagers are stripped from their AI and only restock their offers every so often. Enabling this will lobotomize villagers that are unable to pathfind to their destination. Freeing them should unlobotomize them. + --- ## Misc @@ -149,14 +171,33 @@ Generating treasure maps is extremely expensive and can hang a server if the str ### treasure-maps-return-already-discovered (`paper.yml`) Default value of this option forces the newly generated maps to look for unexplored structure, which are usually outside of your pregenerated terrain. Setting this to true makes it so maps can lead to the structures that were discovered earlier. +### grass-spread-tick-rate (`paper.yml`) +Time in ticks between 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 and have basically noone notice it. + +### non-player-arrow-despawn-rate (`paper.yml`) +Time in ticks after which arrows shot by mobs should disappear after hitting anything. Players can't pick those up anyway, so you may aswell set this to something like `20`. + +### creative-arrow-despawn-rate (`paper.yml`) +Time in ticks after which arrows shot by players in creative mode should disappear after hitting anything. Players can't pick those up anyway, so you may aswell set this to something like `20`. + ### disable-treasure-searching (`purpur.yml`) Prevents dolphins from performing structure search similiar to treasure maps ### teleport-if-outside-border (`purpur.yml`) Allows you to teleport player to the world spawn if they happen to be outside of the world border. Helpful since the vanilla world border is bypassable and the damage it does to the player can be mitigated. -### entities-can-use-portals (`purpur.yml`) -This option can disable portal usage of all entities besides the player. This prevents entities changing worlds loading chunks on main thread. +--- + +## Helpers + +### anti-xray (`paper.yml`) +Enable this to hide ores from x-rayers. For detailed configuration of this feature check out [Stonar96's recommended settings](https://gist.github.com/stonar96/ba18568bd91e5afd590e8038d14e245e). + +### remove-corrupt-tile-entities (`paper.yml`) +Change this to `true` if you're getting your console spammed with errors regarding tileentities. This will remove any tileentities that cause that instead of ignoring it. + +### nether-ceiling-void-damage-height (`paper.yml`) +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 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`. --- From 4b5d42dc785a7ce21180486db2293ae8d483722c Mon Sep 17 00:00:00 2001 From: granny Date: Sat, 27 Feb 2021 12:18:33 -0800 Subject: [PATCH 04/12] formatting and wording --- README.md | 170 +++++++++++++++++++++++++++++------------------------- 1 file changed, 91 insertions(+), 79 deletions(-) diff --git a/README.md b/README.md index 8513854..f6b6c2c 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,12 @@ Guide for version 1.16.5 -WARNING: This version of the guide has experimental layout that is not yet complete! +WARNING: This version of the guide has an experimental layout that is not yet complete! Based on [this guide](https://www.spigotmc.org/threads/guide-server-optimization%E2%9A%A1.283181/) and other sources (all of them are linked throughout the guide when relevant). ## Intro -There will never be a guide that you can follow and it will give you perfect results. Each server has their own needs and limits on how much you can or you are willing to sacrifice. Tinkering around with the options to fine tune them to your servers needs it's what it's all about. This guide only aims to help you understand what options have impact on performance and what exactly they change. If you think you found inaccurate information within the guide you're free to open github issue telling me about it or open a pull request. +There will never be a guide that will give you perfect results. Each server has their own needs and limits on how much you can or are willing to sacrifice. Tinkering around with the options to fine tune them to your servers needs is what it's all about. This guide only aims to help you understand what options have impact on performance and what exactly they change. If you think you found inaccurate information within this guide, you're free to open an issue or set up a pull request. # Preparations @@ -24,7 +24,7 @@ You should stay away from: * Yatopia - "The combined power of Paper forks for maximum instability and unmaintainablity!" - [KennyTV's list of shame](https://github.com/KennyTV/list-of-shame). Nothing more to be said. * 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 server software you have access to. -* Any plugin/software that enables/disables/reloads plugins on runtime. See [this section](#plugins-enablingdisabling-other-plugins) to read why. +* Any plugin/software that enables/disables/reloads plugins on runtime. See [this section](#plugins-enablingdisabling-other-plugins) to understand why. ## Map pregen Map pregeneration is one of the most important steps in improving a low-budget server. This helps out servers that are hosted on a shared cpu/single core node the most, since they can't fully utilize async chunk loading. You can use a plugin such as [chunky](https://github.com/pop4959/Chunky) to pregenerate the world. Make sure to set up a world border so your players don't generate new chunks! Note that pregenning can sometimes take hours depending on the radius you set in the pregen plugin. @@ -37,32 +37,38 @@ It's key to remember that the overworld, nether and the end have separate world ## Networking -### Network-compression-threshold (`server.properties`) -This allows you to set the cap for the size of a packet before the server attempts to compress it. Setting it higher can save some resources at the cost of bandwidth, and setting it to -1 disables it. If your server is in a network with the proxy or on the same machine (with less than 2 ms ping), disabling this (-1) will be beneficial, as usually internal network speeds can handle the additional uncompressed traffic. +### Network-compression-threshold ([`server.properties`]) +This allows you to set the cap for the size of a packet before the server attempts to compress it. Setting it higher can save some resources at the cost of bandwidth, and setting it to -1 disables it. If your server is in a network with a proxy or on the same machine (with less than 2 ms ping), disabling this (-1) will be beneficial, since internal network speeds can usually handle the additional uncompressed traffic. -### use-alternate-keepalive (`purpur.yml`) -you can enable alternate keepalive system, so players with bad connection don't get timed out as often. Has known incompatibility with TCPShield. +### use-alternate-keepalive ([`purpur.yml`]) +you can enable purpur's alternate keepalive system so players with bad connection don't get timed out as often. Has known incompatibility with TCPShield. + +``` +Enabling this sends a keepalive packet once per second to a player, and only kicks for timeout if none of them were responded to in 30 seconds. +Responding to any of them in any order will keep the player connected. AKA, it won't kick your players because 1 packet gets dropped somewhere along the lines +``` +https://pl3xgaming.github.io/PurpurDocs/Configuration/#use-alternate-keepalive --- ## Chunks -### view-distance (`spigot.yml`) -View-distance is distance in chunks around the player that server will tick. Essentially the distance from player that things will happen. This includes mobs being active, crops and saplings growing, etc. You should set this value in `spigot.yml`, as it overwrites the one from `server.properties` and can be set per-world. This option you want to purposefully set low, around `3` or `4`, because of the existance of `no-tick-view-distance`. +### view-distance ([`spigot.yml`]) +View-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 mobs being active, crops and saplings growing, etc. You should set this value in [`spigot.yml`], as it overwrites the one from [`server.properties`] and can be set per-world. This is an option you want to purposefully set low, somewhere around `3` or `4`, because of the existance of `no-tick-view-distance`. -### no-tick-view-distance (`paper.yml`) -This option allows you to set the maximum distance in chunks that players will see. This enables you to have lower `view-distance` and still let players see further. It's important to know that while the chunks beyond actual `view-distance` won't tick, they will still load from your storage, so don't go overboard. `10` is basically maximum of what you should set this to. As of now chunks are sent to the client regardless of their view distance setting, so going on higher values for this option can cause issues for players with slower connection. +### no-tick-view-distance ([`paper.yml`]) +This option allows you to set the maximum distance in chunks that the players will see. This enables you to have lower `view-distance` and still let players see further. It's important to know that while the chunks beyond actual `view-distance` won't tick, they will still load from your storage, so don't go overboard. `10` is basically maximum of what you should set this to. As of now chunks are sent to the client regardless of their view distance setting, so going on higher values for this option can cause issues for players with slower connections. -### delay-chunk-unloads-by (`paper.yml`) -Lets you configure for how long chunks will stay loaded after player leaves. This helps to not constantly load and unload the same chunks when player moves back and forward. Too high values can result in way too many chunks being loaded at once. +### delay-chunk-unloads-by ([`paper.yml`]) +Lets you configure how long chunks will stay loaded after a player leaves. This helps to not constantly load and unload the same chunks when a player moves back and forth. Too high values can result in way too many chunks being loaded at once. -### max-auto-save-chunks-per-tick (`paper.yml`) +### max-auto-save-chunks-per-tick ([`paper.yml`]) Lets you slow down incremental world saving by spreading the task over time even more for better average performance. You might want to set this higher than `8` with more than 20-30 players. If incremental save can't finish in time then bukkit will automatically save leftover chunks at once and begin the process again. -### prevent-moving-into-unloaded-chunks (`paper.yml`) -When enabled, prevents players from moving into unloaded chunks and causing sync loads that bog down the main thread causing lag. The probablility of player stumbling into unloaded chunk is higher the lower your view-distance is. +### prevent-moving-into-unloaded-chunks ([`paper.yml`]) +When enabled, prevents players from moving into unloaded chunks and causing sync loads that bog down the main thread causing lag. The probablility of a player stumbling into an unloaded chunk is higher the lower your view-distance is. -### entity-per-chunk-save-limit (`paper.yml`) +### entity-per-chunk-save-limit ([`paper.yml`]) With the help of this entry you can set limits to how many entities of specified type can be saved. You should provide a limit for each projectile at least to avoid issues with massive amounts of projectiles being saved and your server crashing on loading that. There is an list of all projectiles provided below. Please adjust the limit to your liking. Suggested value for all projectiles is around `10`. You can also add other entities by their type names to that list. ``` entity-per-chunk-save-limit: @@ -85,126 +91,126 @@ entity-per-chunk-save-limit: witherskull: -1 ``` -### armor-stands-tick -In most cases you can safely set this to `false`. If you're using any plugins that modify the behavior or use armor stands and you experience issues with them you shouldn't change this one. +### armor-stands-tick ([`paper.yml`]) +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. -### armor-stands-do-collision-entity-lookups +### armor-stands-do-collision-entity-lookups ([`paper.yml`]) Here you can disable armor stand collisions. This will help if you have a lot of armor stands and don't need them colliding with anything. --- ## Mobs -### per-player-mob-spawns (`paper.yml`) -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 entire mobcap. if you change it to `true`. This will also make the job easier to properly set entity limits, as it makes the math easier. +### per-player-mob-spawns ([`paper.yml`]) +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 also make the job easier to properly set entity limits, as it makes the math easier. -### spawn-limits (`bukkit.yml`) -When `per-player-mob-spawns` is enabled the math limiting mobs is just `playercount*limit`, where "playercount" is current amount of players on the server. Logically, smaller the numbers are, less mobs you're gonna see. Reducing this is a double-edged sword, as yes, your server has less work to do, but in some gamemodes natural mobs are big part of a gameplay. You can go as low as 20 or less if you adjust `mob-spawn-range` properly. If you are using tuinity, you can set mob limits per world in `tuinity.yml`. +### spawn-limits ([`bukkit.yml`]) +When `per-player-mob-spawns` is enabled, the math of limiting mobs is just `[playercount] * [limit]`, where "playercount" is current amount of players on the server. Logically, the smaller the numbers are, the less mobs you're gonna see. Reducing this is a double-edged sword; yes, your server has less work to do, but in some gamemodes natural-spawning mobs are a big part of a gameplay. You can go as low as 20 or less if you adjust `mob-spawn-range` properly. If you are using tuinity, you can set mob limits per world in [`tuinity.yml`]. -### mob-spawn-range (`spigot.yml`) -Allows you to reduce the range (in chunks) of where mobs will spawn around the player. Depending on your server's gamemode and its playercount you might want to reduce this value along with `bukkit.yml`'s `spawn-limits`. +### mob-spawn-range ([`spigot.yml`]) +Allows you to reduce the range (in chunks) of where mobs will spawn around the player. Depending on your server's gamemode and its playercount you might want to reduce this value along with [`bukkit.yml`]'s `spawn-limits`. -### ticks-per (`bukkit.yml`) +### ticks-per ([`bukkit.yml`]) This option sets how often (in ticks) the server attempts to spawn certain living entities. Water/ambient mobs do not need to spawn each tick as they don't usually get killed that quickly. As for monsters: Slightly increasing the time between spawns should not impact spawn rates even in mob farms. In most cases all of the values under this option should be higher than `1`. -### entity-activation-range (`spigot.yml`) -You can set what distance from the player an entity should be for it to tick (do stuff). Reducing those values helps performance, but may result in irresponsive mobs until player gets really close to them. +### entity-activation-range ([`spigot.yml`]) +You can set what distance from the player an entity should be for it to tick (do stuff). Reducing those values helps performance, but may result in irresponsive mobs until the player gets really close to them. -### entity-tracking-range (`spigot.yml`) -This is distance in blocks from which entities will be visible. Reducing those ranges only saves bandwidth, as entities are still ticked above this range. They just won't be sent to players. If set too low this can cause mobs seem to appear out of nowhere near a player. +### entity-tracking-range ([`spigot.yml`]) +This is distance in blocks from which entities will be visible. Reducing those ranges only saves bandwidth, as entities are still ticked above this range. They just won't be sent to players. If set too low this can cause mobs to seem to appear out of nowhere near a player. -### despawn-ranges (`paper.yml`) -Lets you adjust entity despawn ranges (in blocks). Lower those values to clear the mobs that are far away from player faster. You should keep soft range around `30` and adjust hard range to a bit more than your actual view-distance, so mobs don't immediately despawn when player goes just beyond the point of chunk being loaded (this works well because of `delay-chunk-unloads-by` in `paper.yml`). +### despawn-ranges ([`paper.yml`]) +Lets you adjust entity despawn ranges (in blocks). Lower those values to clear the mobs that are far away from the player faster. You should keep soft range around `30` and adjust hard range to a bit more than your actual view-distance, so mobs don't immediately despawn when the player goes just beyond the point of a chunk being loaded (this works well because of `delay-chunk-unloads-by` in [`paper.yml`]). -### tick-inactive-villagers (`spigot.yml`) -This allows you to decide if villagers should be ticked outside of activation range. This will make villagers proceed as normal and ignore activation range. Disabling this will help performance, but might be confusing for players in certain situations. +### tick-inactive-villagers ([`spigot.yml`]) +This allows you to decide if 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. -### nerf-spawner-mobs (`spigot.yml`) -You can make mobs spawned by 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.yml`. +### nerf-spawner-mobs ([`spigot.yml`]) +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.yml`]. -### max-entity-collisions (`paper.yml`) -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 inablity to push other entities, including players. Value of `2` should be enough in most cases. +### max-entity-collisions ([`paper.yml`]) +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 inablity to push other entities, including players. Value of `2` should be enough in most cases. -### update-pathfinding-on-block-update (`paper.yml`) -Disabling this will result in less pathfinding being done, increasing performance, but mobs can appear more laggy, as they will just passively update their path every 5 ticks (0.25 sec). +### update-pathfinding-on-block-update ([`paper.yml`]) +Disabling this will result in less pathfinding being done, increasing performance, but mobs can appear more laggy; They will just passively update their path every 5 ticks (0.25 sec). -### fix-climbing-bypassing-cramming-rule (`paper.yml`) +### fix-climbing-bypassing-cramming-rule ([`paper.yml`]) Enabling this will fix entities not being affected by cramming while climbing. This will prevent absurd amounts of mobs being stacked in small spaces even if they're climbing (spiders). -### dont-send-useless-entity-packets (`purpur.yml`) -Enabling this option will save you bandwidth by preventing the server from sending empty position change packets (by default server sends this packet for each entity even if the entity hasn't moved). May cause some issues with plugins that use client-side entities. +### dont-send-useless-entity-packets ([`purpur.yml`]) +Enabling this option will save you bandwidth by preventing the server from sending empty position change packets (by default the server sends this packet for each entity even if the entity hasn't moved). May cause some issues with plugins that use client-side entities. -### aggressive-towards-villager-when-lagging (`purpur.yml`) -Enabling this will cause zombies to stop targeting villagers if server is below tps treshold set in `lagging-threshold` in `purpur.yml`. +### aggressive-towards-villager-when-lagging ([`purpur.yml`]) +Enabling this will cause zombies to stop targeting villagers if the server is below the tps treshold set with `lagging-threshold` in [`purpur.yml`]. -### entities-can-use-portals (`purpur.yml`) -This option can disable portal usage of all entities besides the player. This prevents entities changing worlds loading chunks on main thread. +### entities-can-use-portals (``purpur.yml``) +This option can disable portal usage of all entities besides the player. This prevents entities from loading chunks by changing worlds which is handled on the main thread. -### villager.brain-ticks (`purpur.yml`) +### villager.brain-ticks ([`purpur.yml`]) This option allows you to set how often (in ticks) villager brains (work and poi) will tick. Going higher than `3` is confirmed to make villagers inconsistant/buggy. -### villager.lobotomize (`purpur.yml`) +### villager.lobotomize ([`purpur.yml`]) Lobotomized villagers are stripped from their AI and only restock their offers every so often. Enabling this will lobotomize villagers that are unable to pathfind to their destination. Freeing them should unlobotomize them. --- ## Misc -### merge-radius (`spigot.yml`) +### merge-radius ([`spigot.yml`]) 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. -### alt-item-despawn-rate (`paper.yml`) -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 gain performance. +### alt-item-despawn-rate ([`paper.yml`]) +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. -### use-faster-eigencraft-redstone (`paper.yml`) -When endabled, the redstone system is replaced by a faster, alternative version that reduces redundant block updates reducing the amount of work your server has to do. +### use-faster-eigencraft-redstone ([`paper.yml`]) +When enabled, the redstone system is replaced by a faster and alternative version that reduces redundant block updates, lowering the amount of work your server has to do. -### disable-move-event (`paper.yml`) +### disable-move-event ([`paper.yml`]) `InventoryMoveItemEvent` doesn't fire 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!** -### optimize-explosions (`paper.yml`) -Setting this to `true` replaces vanilla explosion algorithm to a faster one, at a cost of slight inaccuracy when calculating explosion damage. This is usually not noticeable. +### optimize-explosions ([`paper.yml`]) +Setting this to `true` replaces the vanilla explosion algorithm with a faster one, at a cost of slight inaccuracy when calculating explosion damage. This is usually not noticeable. -### enable-treasure-maps (`paper.yml`) +### enable-treasure-maps ([`paper.yml`]) Generating treasure maps is extremely expensive and can hang a server if the structure it's trying to locate is outside of your pregenerated world. It's only safe to enable this if you pregenerated your world and set a vanilla world border. -### treasure-maps-return-already-discovered (`paper.yml`) +### treasure-maps-return-already-discovered ([`paper.yml`]) Default value of this option forces the newly generated maps to look for unexplored structure, which are usually outside of your pregenerated terrain. Setting this to true makes it so maps can lead to the structures that were discovered earlier. -### grass-spread-tick-rate (`paper.yml`) -Time in ticks between 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 and have basically noone notice it. +### grass-spread-tick-rate ([`paper.yml`]) +Time in ticks the server is 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 it being noticeable. -### non-player-arrow-despawn-rate (`paper.yml`) -Time in ticks after which arrows shot by mobs should disappear after hitting anything. Players can't pick those up anyway, so you may aswell set this to something like `20`. +### non-player-arrow-despawn-rate ([`paper.yml`]) +Time in ticks arrows shot by mobs should disappear after hitting something. Players can't pick these up anyway, so you may aswell set this to something like `20`. -### creative-arrow-despawn-rate (`paper.yml`) -Time in ticks after which arrows shot by players in creative mode should disappear after hitting anything. Players can't pick those up anyway, so you may aswell set this to something like `20`. +### creative-arrow-despawn-rate ([`paper.yml`]) +Time in ticks arrows shot by players in creative mode should disappear after hitting something. Players can't pick these up anyway, so you may aswell set this to something like `20`. -### disable-treasure-searching (`purpur.yml`) +### disable-treasure-searching ([`purpur.yml`]) Prevents dolphins from performing structure search similiar to treasure maps -### teleport-if-outside-border (`purpur.yml`) -Allows you to teleport player to the world spawn if they happen to be outside of the world border. Helpful since the vanilla world border is bypassable and the damage it does to the player can be mitigated. +### teleport-if-outside-border ([`purpur.yml`]) +Allows you to teleport the player to the world spawn if they happen to be outside of the world border. Helpful since the vanilla world border is bypassable and the damage it does to the player can be mitigated. --- ## Helpers -### anti-xray (`paper.yml`) +### anti-xray ([`paper.yml`]) Enable this to hide ores from x-rayers. For detailed configuration of this feature check out [Stonar96's recommended settings](https://gist.github.com/stonar96/ba18568bd91e5afd590e8038d14e245e). -### remove-corrupt-tile-entities (`paper.yml`) -Change this to `true` if you're getting your console spammed with errors regarding tileentities. This will remove any tileentities that cause that instead of ignoring it. +### remove-corrupt-tile-entities ([`paper.yml`]) +Change this to `true` if you're getting your console spammed with errors regarding tile entities. This will remove any tile entities that cause the error instead of ignoring it. -### nether-ceiling-void-damage-height (`paper.yml`) -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 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`. +### nether-ceiling-void-damage-height ([`paper.yml`]) +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`. --- ## Java startup flags [Paper and its forks in upcoming version 1.17 will require Java 11 (LTS) or higher](https://papermc.io/forums/t/java-11-mc-1-17-and-paper/5615). Good 2021 resolution to finally update your version of Java! (or at least inform your host so they can handle the migration). -JVM can be configured to reduce lag spikes caused by big garbage collector tasks. You can find startup flags optimized for minecraft servers [here](https://mcflags.emc.gs/) [SOG]. +JVM can be configured to reduce lag spikes caused by big garbage collector tasks. You can find startup flags optimized for minecraft servers [here](https://mcflags.emc.gs/) [`SOG`]. ## "Too good to be true" plugins @@ -215,20 +221,26 @@ Absolutely unnecessary since they can be replaced with [merge radius](#merge-rad It's really hard to justify using one. Stacking naturally spawned entities causes more lag than not stacking them at all due to the server constantly trying to spawn more mobs. The only "acceptable" use case is for spawners on servers with a large amount of spawners. ### Plugins enabling/disabling other plugins -Anything that enables or disables plugins on runtime is extremely dangerous. Loading a plugin like that can cause fatal errors with tracking data and disabling a plugin can lead to errors due to removing dependency. The `/reload` command suffers from exact same issues and you can read more about them in [this me4502's blog post](https://matthewmiller.dev/blog/problem-with-reload/) +Anything that enables or disables plugins on runtime is extremely dangerous. Loading a plugin like that can cause fatal errors with tracking data and disabling a plugin can lead to errors due to removing dependency. The `/reload` command suffers from exact same issues and you can read more about them in [me4502's blog post](https://matthewmiller.dev/blog/problem-with-reload/) ## What's lagging? - measuring performance ### mspt -Paper offers a `/mspt` command that will tell you how much time server took to calculate recent ticks. If the first and second value you see are lower than 50, then congratulations! Your server is not lagging! If the third value is over 50 then it means there was at least 1 tick that took longer. That's completely normal and happens from time to time, so don't panic. +Paper offers a `/mspt` command that will tell you how much time the server took to calculate recent ticks. If the first and second value you see are lower than 50, then congratulations! Your server is not lagging! If the third value is over 50 then it means there was at least 1 tick that took longer. That's completely normal and happens from time to time, so don't panic. ### timings Great way to see what might be going on when your server is lagging are timings. Timings is a tool that lets you see exactly what tasks are taking the longest. It's the most basic troubleshooting tool and if you ask for help regarding lag you will most likely be asked for your timings. -To get timings of your server you just need to execute `/timings paste` command and click the link you're provided with. You can share this link with other people to let them help you. It's also easy to misread if you don't know what you're doing. There is a detailed [video tutorial by Aikar](https://www.youtube.com/watch?v=T4J0A9l7bfQ) on how to read them. +To get timings of your server you just need to execute the `/timings paste` command and click the link you're provided with. You can share this link with other people to let them help you. It's also easy to misread if you don't know what you're doing. There is a detailed [video tutorial by Aikar](https://www.youtube.com/watch?v=T4J0A9l7bfQ) on how to read them. ### spark [Spark](https://github.com/lucko/spark) is a plugin that allows you to profile your servers CPU and memory usage. You can read on how to use it [on its wiki](https://github.com/lucko/spark/wiki/Commands). There's also a guide on how to find the cause of lag spikes [here](https://github.com/lucko/spark/wiki/Finding-the-cause-of-lag-spikes). -[SOG]: https://www.spigotmc.org/threads/guide-server-optimization%E2%9A%A1.283181/ \ No newline at end of file +[`SOG`]: https://www.spigotmc.org/threads/guide-server-optimization%E2%9A%A1.283181/ +[`server.properties`]: https://minecraft.gamepedia.com/Server.properties +[`bukkit.yml`]: https://bukkit.gamepedia.com/Bukkit.yml +[`spigot.yml`]: https://www.spigotmc.org/wiki/spigot-configuration/ +[`paper.yml`]: https://paper.readthedocs.io/en/latest/server/configuration.html +[`purpur.yml`]: https://purpur.pl3x.net/docs +[`tuinity.yml`]: https://github.com/Spottedleaf/Tuinity/wiki/Config \ No newline at end of file From 5c13660af7491bb1119b91c19567a6a48e1f5d7c Mon Sep 17 00:00:00 2001 From: granny Date: Sat, 27 Feb 2021 12:34:19 -0800 Subject: [PATCH 05/12] common-pitfalls-and-best-practices wording & formatting --- common-pitfalls-and-best-practices.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/common-pitfalls-and-best-practices.md b/common-pitfalls-and-best-practices.md index 38dbf90..b415e5e 100644 --- a/common-pitfalls-and-best-practices.md +++ b/common-pitfalls-and-best-practices.md @@ -3,16 +3,16 @@ This article aims to explain common pitfalls that server owners face. ## Always backup -There are two types of people - ones making backups, and ones that will start making backups. It's just a matter of time when you experience data loss, always make copies to avoid losing your worlds or plugin data. You can apply this to any computer related workflow, not only minecraft. +There are two types of people - those who make backups, and those who will start making backups. It's just a matter of time when you experience data loss. Always make copies to avoid losing your worlds or plugin data. You can apply this to any computer related workflow, not just minecraft. ## Don't use outdated software -By running outdated software versions you risk players abusing unpatched exploits including item duplication (infinite items). Besides that your players have to specifically downgrade their client version to match your server unless you use a protocol hack, which is not ideal aswell. +By running outdated software versions you risk players abusing unpatched exploits, including item duplication (infinite items). It also plays in inconvenience factor since your players have to specifically downgrade their client version to match your server. This can be circumvented by using a protocol hack, but it's not ideal. ## Don't run bukkit/spigot anymore -Bukkit and spigot are basically in maintenence mode. They update version and critical exploits, but don't add any performance updates. This means you will most likely experience performance issues on those. To avoid that upgrade to [paper](https://papermc.io/downloads), [tuinity](https://ci.codemc.io/job/Spottedleaf/job/Tuinity) or [purpur](https://purpur.pl3x.net/downloads) which support 99.99% of the spigot plugins (the general rule is if a plugin works on spigot but doesn't work on paper plugin dev did a bad job or messes with things that they shouldn't mess with). In addition those forks also add optimization patches, like chunk loading system that can take advantage of multiple cpu threads or a setting that allows the server to tick less chunks that it actually sends to the player. See the [main optimization guide](https://github.com/YouHaveTrouble/minecraft-optimization) for details. +Bukkit and spigot are basically in maintenence mode. They update anytime there's a new version and if a critical exploit is found, but don't add any performance updates. This means any performance issues you may experience on those softwares will never be improved over time. To avoid that, upgrade to [paper](https://papermc.io/downloads), [tuinity](https://ci.codemc.io/job/Spottedleaf/job/Tuinity) or [purpur](https://purpur.pl3x.net/downloads). Bukkit/Spigot plugins will work just as well (maybe even better) with the server software listed. If they don't, then it's safe to assume that the plugin dev is either doing things that they shouldn't or did a negligent job creating their plugin. They also add optimization patches like a chunk loading system that can take advantage of multiple cpu threads or a setting that allows the server to tick less chunks than it actually sends to the player. See the [main optimization guide](https://github.com/YouHaveTrouble/minecraft-optimization) for more details. ## Avoid shared hosting if possible -Shared hosts are usually the cheapest option, and that's for a reason. They offer you 2 types of resources - guaranteed and shared. Guaranteed resources are usually laughably low and may be even not enough to run a server for a few players. Shared resources is different story, that's usually enough to run a server with decent performance. There is a catch though. Shared resources, like name implies are shared between your server and other servers on the same physical machine. Your server can only benefit from having them when no other server uses them. The situation where your server fully utilises shared resources is pretty much impossible to happen, as most shared hosts oversell the resources. Like airplane tickets, hosting site sells more resources than they have available in hopes that not all of them will be used. This often leads to situations where all servers are bogged down because there aren't enough resources to spare. +Shared hosts are usually the cheapest option, and that's for a valid reason. They offer you 2 types of resources - guaranteed and shared. Guaranteed resources are usually laughably low and may not be enough to run a server for a few players. Shared resources on the other hand are usually enough to run a server with decent performance. There is a catch, though; shared resources, like the name implies, are shared between your server and other servers on the same physical machine. Your server can only benefit from having them when no other server uses them. The situation where your server fully utilises shared resources is pretty much impossible to happen, as most shared hosts oversell their resources. Like airplane tickets, the hosting site sells more resources than they have available in hopes that not all of them will be used. This often leads to situations where all servers are bogged down because there aren't enough resources to spare. ## Avoid datapacks that use command functions -Datapacks that run commands are extremely laggy. It may not be much with a few players on, but that doesn't scale well with playercount and will lag your server pretty quickly if you get more players. Datapacks that modify biomes/loottables etc are fine. If they use command functions you're better off looking for a plugin alternative. \ No newline at end of file +Datapacks that run commands are extremely laggy. It may not be much with a few players on, but that doesn't scale well with the playercount and will lag your server pretty quickly as you gain players. Datapacks that modify biomes, loot tables, etc are fine. You're better off looking for a plugin alternative. \ No newline at end of file From 6be1910764654a86d8a7abcb4301cd498fb1e6b7 Mon Sep 17 00:00:00 2001 From: YouHaveTrouble Date: Sun, 28 Feb 2021 01:12:20 +0100 Subject: [PATCH 06/12] sort by config --- README.md | 130 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 77 insertions(+), 53 deletions(-) diff --git a/README.md b/README.md index f6b6c2c..a5e2b9c 100644 --- a/README.md +++ b/README.md @@ -37,10 +37,14 @@ It's key to remember that the overworld, nether and the end have separate world ## Networking -### Network-compression-threshold ([`server.properties`]) +### [`server.properties`] + +#### Network-compression-threshold This allows you to set the cap for the size of a packet before the server attempts to compress it. Setting it higher can save some resources at the cost of bandwidth, and setting it to -1 disables it. If your server is in a network with a proxy or on the same machine (with less than 2 ms ping), disabling this (-1) will be beneficial, since internal network speeds can usually handle the additional uncompressed traffic. -### use-alternate-keepalive ([`purpur.yml`]) +### [`purpur.yml`] + +#### use-alternate-keepalive you can enable purpur's alternate keepalive system so players with bad connection don't get timed out as often. Has known incompatibility with TCPShield. ``` @@ -53,22 +57,26 @@ https://pl3xgaming.github.io/PurpurDocs/Configuration/#use-alternate-keepalive ## Chunks -### view-distance ([`spigot.yml`]) +### [`spigot.yml`] + +#### view-distance View-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 mobs being active, crops and saplings growing, etc. You should set this value in [`spigot.yml`], as it overwrites the one from [`server.properties`] and can be set per-world. This is an option you want to purposefully set low, somewhere around `3` or `4`, because of the existance of `no-tick-view-distance`. -### no-tick-view-distance ([`paper.yml`]) +### [`paper.yml`] + +#### no-tick-view-distance This option allows you to set the maximum distance in chunks that the players will see. This enables you to have lower `view-distance` and still let players see further. It's important to know that while the chunks beyond actual `view-distance` won't tick, they will still load from your storage, so don't go overboard. `10` is basically maximum of what you should set this to. As of now chunks are sent to the client regardless of their view distance setting, so going on higher values for this option can cause issues for players with slower connections. -### delay-chunk-unloads-by ([`paper.yml`]) +#### delay-chunk-unloads-by Lets you configure how long chunks will stay loaded after a player leaves. This helps to not constantly load and unload the same chunks when a player moves back and forth. Too high values can result in way too many chunks being loaded at once. -### max-auto-save-chunks-per-tick ([`paper.yml`]) +#### max-auto-save-chunks-per-tick Lets you slow down incremental world saving by spreading the task over time even more for better average performance. You might want to set this higher than `8` with more than 20-30 players. If incremental save can't finish in time then bukkit will automatically save leftover chunks at once and begin the process again. -### prevent-moving-into-unloaded-chunks ([`paper.yml`]) +#### prevent-moving-into-unloaded-chunks When enabled, prevents players from moving into unloaded chunks and causing sync loads that bog down the main thread causing lag. The probablility of a player stumbling into an unloaded chunk is higher the lower your view-distance is. -### entity-per-chunk-save-limit ([`paper.yml`]) +#### entity-per-chunk-save-limit With the help of this entry you can set limits to how many entities of specified type can be saved. You should provide a limit for each projectile at least to avoid issues with massive amounts of projectiles being saved and your server crashing on loading that. There is an list of all projectiles provided below. Please adjust the limit to your liking. Suggested value for all projectiles is around `10`. You can also add other entities by their type names to that list. ``` entity-per-chunk-save-limit: @@ -91,118 +99,134 @@ entity-per-chunk-save-limit: witherskull: -1 ``` -### armor-stands-tick ([`paper.yml`]) +#### armor-stands-tick 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. -### armor-stands-do-collision-entity-lookups ([`paper.yml`]) +#### armor-stands-do-collision-entity-lookups Here you can disable armor stand collisions. This will help if you have a lot of armor stands and don't need them colliding with anything. --- ## Mobs -### per-player-mob-spawns ([`paper.yml`]) -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 also make the job easier to properly set entity limits, as it makes the math easier. +### [`bukkit.yml`] -### spawn-limits ([`bukkit.yml`]) +#### spawn-limits When `per-player-mob-spawns` is enabled, the math of limiting mobs is just `[playercount] * [limit]`, where "playercount" is current amount of players on the server. Logically, the smaller the numbers are, the less mobs you're gonna see. Reducing this is a double-edged sword; yes, your server has less work to do, but in some gamemodes natural-spawning mobs are a big part of a gameplay. You can go as low as 20 or less if you adjust `mob-spawn-range` properly. If you are using tuinity, you can set mob limits per world in [`tuinity.yml`]. -### mob-spawn-range ([`spigot.yml`]) -Allows you to reduce the range (in chunks) of where mobs will spawn around the player. Depending on your server's gamemode and its playercount you might want to reduce this value along with [`bukkit.yml`]'s `spawn-limits`. - -### ticks-per ([`bukkit.yml`]) +#### ticks-per This option sets how often (in ticks) the server attempts to spawn certain living entities. Water/ambient mobs do not need to spawn each tick as they don't usually get killed that quickly. As for monsters: Slightly increasing the time between spawns should not impact spawn rates even in mob farms. In most cases all of the values under this option should be higher than `1`. -### entity-activation-range ([`spigot.yml`]) +### [`spigot.yml`] + +#### mob-spawn-range +Allows you to reduce the range (in chunks) of where mobs will spawn around the player. Depending on your server's gamemode and its playercount you might want to reduce this value along with [`bukkit.yml`]'s `spawn-limits`. + +#### entity-activation-range You can set what distance from the player an entity should be for it to tick (do stuff). Reducing those values helps performance, but may result in irresponsive mobs until the player gets really close to them. -### entity-tracking-range ([`spigot.yml`]) +#### entity-tracking-range This is distance in blocks from which entities will be visible. Reducing those ranges only saves bandwidth, as entities are still ticked above this range. They just won't be sent to players. If set too low this can cause mobs to seem to appear out of nowhere near a player. -### despawn-ranges ([`paper.yml`]) -Lets you adjust entity despawn ranges (in blocks). Lower those values to clear the mobs that are far away from the player faster. You should keep soft range around `30` and adjust hard range to a bit more than your actual view-distance, so mobs don't immediately despawn when the player goes just beyond the point of a chunk being loaded (this works well because of `delay-chunk-unloads-by` in [`paper.yml`]). - -### tick-inactive-villagers ([`spigot.yml`]) +#### tick-inactive-villagers This allows you to decide if 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. -### nerf-spawner-mobs ([`spigot.yml`]) +#### nerf-spawner-mobs 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.yml`]. -### max-entity-collisions ([`paper.yml`]) +### [`paper.yml`] + +#### despawn-ranges +Lets you adjust entity despawn ranges (in blocks). Lower those values to clear the mobs that are far away from the player faster. You should keep soft range around `30` and adjust hard range to a bit more than your actual view-distance, so mobs don't immediately despawn when the player goes just beyond the point of a chunk being loaded (this works well because of `delay-chunk-unloads-by` in [`paper.yml`]). + +#### per-player-mob-spawns +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 also make the job easier to properly set entity limits, as it makes the math easier. + +#### max-entity-collisions 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 inablity to push other entities, including players. Value of `2` should be enough in most cases. -### update-pathfinding-on-block-update ([`paper.yml`]) +#### update-pathfinding-on-block-update Disabling this will result in less pathfinding being done, increasing performance, but mobs can appear more laggy; They will just passively update their path every 5 ticks (0.25 sec). -### fix-climbing-bypassing-cramming-rule ([`paper.yml`]) +#### fix-climbing-bypassing-cramming-rule Enabling this will fix entities not being affected by cramming while climbing. This will prevent absurd amounts of mobs being stacked in small spaces even if they're climbing (spiders). -### dont-send-useless-entity-packets ([`purpur.yml`]) +### [`purpur.yml`] + +#### dont-send-useless-entity-packets Enabling this option will save you bandwidth by preventing the server from sending empty position change packets (by default the server sends this packet for each entity even if the entity hasn't moved). May cause some issues with plugins that use client-side entities. -### aggressive-towards-villager-when-lagging ([`purpur.yml`]) +#### aggressive-towards-villager-when-lagging Enabling this will cause zombies to stop targeting villagers if the server is below the tps treshold set with `lagging-threshold` in [`purpur.yml`]. -### entities-can-use-portals (``purpur.yml``) +#### entities-can-use-portals This option can disable portal usage of all entities besides the player. This prevents entities from loading chunks by changing worlds which is handled on the main thread. -### villager.brain-ticks ([`purpur.yml`]) +#### villager.brain-ticks This option allows you to set how often (in ticks) villager brains (work and poi) will tick. Going higher than `3` is confirmed to make villagers inconsistant/buggy. -### villager.lobotomize ([`purpur.yml`]) +#### villager.lobotomize Lobotomized villagers are stripped from their AI and only restock their offers every so often. Enabling this will lobotomize villagers that are unable to pathfind to their destination. Freeing them should unlobotomize them. --- ## Misc -### merge-radius ([`spigot.yml`]) +### [`spigot.yml`] + +#### merge-radius 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. -### alt-item-despawn-rate ([`paper.yml`]) +### [`paper.yml`] + +#### alt-item-despawn-rate 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. -### use-faster-eigencraft-redstone ([`paper.yml`]) +#### use-faster-eigencraft-redstone When enabled, the redstone system is replaced by a faster and alternative version that reduces redundant block updates, lowering the amount of work your server has to do. -### disable-move-event ([`paper.yml`]) +#### disable-move-event `InventoryMoveItemEvent` doesn't fire 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!** -### optimize-explosions ([`paper.yml`]) +#### optimize-explosions Setting this to `true` replaces the vanilla explosion algorithm with a faster one, at a cost of slight inaccuracy when calculating explosion damage. This is usually not noticeable. -### enable-treasure-maps ([`paper.yml`]) +#### enable-treasure-maps Generating treasure maps is extremely expensive and can hang a server if the structure it's trying to locate is outside of your pregenerated world. It's only safe to enable this if you pregenerated your world and set a vanilla world border. -### treasure-maps-return-already-discovered ([`paper.yml`]) +#### treasure-maps-return-already-discovered Default value of this option forces the newly generated maps to look for unexplored structure, which are usually outside of your pregenerated terrain. Setting this to true makes it so maps can lead to the structures that were discovered earlier. -### grass-spread-tick-rate ([`paper.yml`]) +#### grass-spread-tick-rate Time in ticks the server is 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 it being noticeable. -### non-player-arrow-despawn-rate ([`paper.yml`]) +#### non-player-arrow-despawn-rate Time in ticks arrows shot by mobs should disappear after hitting something. Players can't pick these up anyway, so you may aswell set this to something like `20`. -### creative-arrow-despawn-rate ([`paper.yml`]) +#### creative-arrow-despawn-rate Time in ticks arrows shot by players in creative mode should disappear after hitting something. Players can't pick these up anyway, so you may aswell set this to something like `20`. -### disable-treasure-searching ([`purpur.yml`]) +### [`purpur.yml`] + +#### disable-treasure-searching Prevents dolphins from performing structure search similiar to treasure maps -### teleport-if-outside-border ([`purpur.yml`]) +#### teleport-if-outside-border Allows you to teleport the player to the world spawn if they happen to be outside of the world border. Helpful since the vanilla world border is bypassable and the damage it does to the player can be mitigated. --- ## Helpers -### anti-xray ([`paper.yml`]) +### [`paper.yml`] + +#### anti-xray Enable this to hide ores from x-rayers. For detailed configuration of this feature check out [Stonar96's recommended settings](https://gist.github.com/stonar96/ba18568bd91e5afd590e8038d14e245e). -### remove-corrupt-tile-entities ([`paper.yml`]) +#### remove-corrupt-tile-entities Change this to `true` if you're getting your console spammed with errors regarding tile entities. This will remove any tile entities that cause the error instead of ignoring it. -### nether-ceiling-void-damage-height ([`paper.yml`]) +#### nether-ceiling-void-damage-height 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`. --- @@ -214,26 +238,26 @@ JVM can be configured to reduce lag spikes caused by big garbage collector tasks ## "Too good to be true" plugins -### Plugins removing ground items +#### Plugins removing ground items Absolutely unnecessary since they can be replaced with [merge radius](#merge-radius) and [alt-item-despawn-rate](#alt-item-despawn-rateenabled) and frankly, they're less configurable than basic server configs. They tend to use more resources scanning and removing items than not removing the items at all. -### Mob stacker plugins +#### Mob stacker plugins It's really hard to justify using one. Stacking naturally spawned entities causes more lag than not stacking them at all due to the server constantly trying to spawn more mobs. The only "acceptable" use case is for spawners on servers with a large amount of spawners. -### Plugins enabling/disabling other plugins +#### Plugins enabling/disabling other plugins Anything that enables or disables plugins on runtime is extremely dangerous. Loading a plugin like that can cause fatal errors with tracking data and disabling a plugin can lead to errors due to removing dependency. The `/reload` command suffers from exact same issues and you can read more about them in [me4502's blog post](https://matthewmiller.dev/blog/problem-with-reload/) ## What's lagging? - measuring performance -### mspt +#### mspt Paper offers a `/mspt` command that will tell you how much time the server took to calculate recent ticks. If the first and second value you see are lower than 50, then congratulations! Your server is not lagging! If the third value is over 50 then it means there was at least 1 tick that took longer. That's completely normal and happens from time to time, so don't panic. -### timings +#### timings Great way to see what might be going on when your server is lagging are timings. Timings is a tool that lets you see exactly what tasks are taking the longest. It's the most basic troubleshooting tool and if you ask for help regarding lag you will most likely be asked for your timings. To get timings of your server you just need to execute the `/timings paste` command and click the link you're provided with. You can share this link with other people to let them help you. It's also easy to misread if you don't know what you're doing. There is a detailed [video tutorial by Aikar](https://www.youtube.com/watch?v=T4J0A9l7bfQ) on how to read them. -### spark +#### spark [Spark](https://github.com/lucko/spark) is a plugin that allows you to profile your servers CPU and memory usage. You can read on how to use it [on its wiki](https://github.com/lucko/spark/wiki/Commands). There's also a guide on how to find the cause of lag spikes [here](https://github.com/lucko/spark/wiki/Finding-the-cause-of-lag-spikes). From 93584068ad60b17309e4e790504c338d7f1e4c69 Mon Sep 17 00:00:00 2001 From: YouHaveTrouble Date: Sun, 28 Feb 2021 14:06:35 +0100 Subject: [PATCH 07/12] fix typo --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a5e2b9c..561111a 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ It's key to remember that the overworld, nether and the end have separate world ### [`server.properties`] -#### Network-compression-threshold +#### network-compression-threshold This allows you to set the cap for the size of a packet before the server attempts to compress it. Setting it higher can save some resources at the cost of bandwidth, and setting it to -1 disables it. If your server is in a network with a proxy or on the same machine (with less than 2 ms ping), disabling this (-1) will be beneficial, since internal network speeds can usually handle the additional uncompressed traffic. ### [`purpur.yml`] @@ -195,7 +195,7 @@ Setting this to `true` replaces the vanilla explosion algorithm with a faster on Generating treasure maps is extremely expensive and can hang a server if the structure it's trying to locate is outside of your pregenerated world. It's only safe to enable this if you pregenerated your world and set a vanilla world border. #### treasure-maps-return-already-discovered -Default value of this option forces the newly generated maps to look for unexplored structure, which are usually outside of your pregenerated terrain. Setting this to true makes it so maps can lead to the structures that were discovered earlier. +Default value of this option forces the newly generated maps to look for unexplored structure, which are usually outside of your pregenerated terrain. Setting this to true makes it so maps can lead to the structures that were discovered earlier. If you don't change this to `true` you may experience server hangs or crashes when generating new treasure maps. #### grass-spread-tick-rate Time in ticks the server is 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 it being noticeable. From 99495de9ef846a3b1385537b7d92004b65e4b533 Mon Sep 17 00:00:00 2001 From: YouHaveTrouble Date: Thu, 4 Mar 2021 02:26:32 +0100 Subject: [PATCH 08/12] added basic hardware tips --- common-pitfalls-and-best-practices.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common-pitfalls-and-best-practices.md b/common-pitfalls-and-best-practices.md index b415e5e..43eea4e 100644 --- a/common-pitfalls-and-best-practices.md +++ b/common-pitfalls-and-best-practices.md @@ -15,4 +15,7 @@ Bukkit and spigot are basically in maintenence mode. They update anytime there's Shared hosts are usually the cheapest option, and that's for a valid reason. They offer you 2 types of resources - guaranteed and shared. Guaranteed resources are usually laughably low and may not be enough to run a server for a few players. Shared resources on the other hand are usually enough to run a server with decent performance. There is a catch, though; shared resources, like the name implies, are shared between your server and other servers on the same physical machine. Your server can only benefit from having them when no other server uses them. The situation where your server fully utilises shared resources is pretty much impossible to happen, as most shared hosts oversell their resources. Like airplane tickets, the hosting site sells more resources than they have available in hopes that not all of them will be used. This often leads to situations where all servers are bogged down because there aren't enough resources to spare. ## Avoid datapacks that use command functions -Datapacks that run commands are extremely laggy. It may not be much with a few players on, but that doesn't scale well with the playercount and will lag your server pretty quickly as you gain players. Datapacks that modify biomes, loot tables, etc are fine. You're better off looking for a plugin alternative. \ No newline at end of file +Datapacks that run commands are extremely laggy. It may not be much with a few players on, but that doesn't scale well with the playercount and will lag your server pretty quickly as you gain players. Datapacks that modify biomes, loot tables, etc are fine. You're better off looking for a plugin alternative. + +## Choosing hardware +Don't just go off how much RAM you need. That's basically a non-issue, as you can run 100+ players on less than 16GB RAM with a lot of room to spare (unless you're using questionable plugins that cache unnecessary things). CPU is probably most important piece of the puzzle. You want something that [ranks good on single core performance](https://www.cpubenchmark.net/singleThread.html), as server's main thread runs on just one thread. It's important to note that this does not mean the entirety of the server uses only one thread. Multiple threads are utilised for quite some time now in systems like async chunk loading on paper. You should absolutely avoid HDD drives. Their speeds are simply way too slow to to justify running a server on them, and minecraft is heavy on I/O operations, especially with high viewdistances and higher playercounts. \ No newline at end of file From 9a30330166d973ace0e09f8396a4405270e5fb68 Mon Sep 17 00:00:00 2001 From: YouHaveTrouble Date: Thu, 4 Mar 2021 02:58:17 +0100 Subject: [PATCH 09/12] added final? missing stuff --- README.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 561111a..26ebd41 100644 --- a/README.md +++ b/README.md @@ -177,6 +177,12 @@ Lobotomized villagers are stripped from their AI and only restock their offers e #### merge-radius 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. +#### hopper-transfer +Time peroid in ticks that hoppers will wait to move an item. Increasing this will help performance if there are a lot of hoppers on your server, but will break hopper-based clocks and possibly item sorting systems. + +#### hopper-check +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 possibly item sorting systems. + ### [`paper.yml`] #### alt-item-despawn-rate @@ -188,6 +194,9 @@ When enabled, the redstone system is replaced by a faster and alternative versio #### disable-move-event `InventoryMoveItemEvent` doesn't fire 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!** +#### mob-spawner-tick-rate +This option lets you configure how often spawners should be ticked. Higher values mean less lag if you have a lot of spawners, but spawners will spawn mobs less often if you increase this. + #### optimize-explosions Setting this to `true` replaces the vanilla explosion algorithm with a faster one, at a cost of slight inaccuracy when calculating explosion damage. This is usually not noticeable. @@ -198,13 +207,16 @@ Generating treasure maps is extremely expensive and can hang a server if the str Default value of this option forces the newly generated maps to look for unexplored structure, which are usually outside of your pregenerated terrain. Setting this to true makes it so maps can lead to the structures that were discovered earlier. If you don't change this to `true` you may experience server hangs or crashes when generating new treasure maps. #### grass-spread-tick-rate -Time in ticks the server is 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 it being noticeable. +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 it being noticeable. + +#### container-update-tick-rate +Time in ticks between container updates. Increasing this might help if container updates cause issues for you (it rarely happens). Increasing this value makes it easier for players to experience desync when interacting with inventories (ghost items). #### non-player-arrow-despawn-rate -Time in ticks arrows shot by mobs should disappear after hitting something. Players can't pick these up anyway, so you may aswell set this to something like `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 aswell set this to something like `20`. #### creative-arrow-despawn-rate -Time in ticks arrows shot by players in creative mode should disappear after hitting something. Players can't pick these up anyway, so you may aswell set this to something like `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 aswell set this to something like `20`. ### [`purpur.yml`] From cb260b88afb08b15ea94f305b7bc0f8875b63a84 Mon Sep 17 00:00:00 2001 From: granny Date: Thu, 4 Mar 2021 01:16:21 -0800 Subject: [PATCH 10/12] formatting and wording --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 26ebd41..8cc3af6 100644 --- a/README.md +++ b/README.md @@ -178,7 +178,7 @@ Lobotomized villagers are stripped from their AI and only restock their offers e 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. #### hopper-transfer -Time peroid in ticks that hoppers will wait to move an item. Increasing this will help performance if there are a lot of hoppers on your server, but will break hopper-based clocks and possibly item sorting systems. +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. #### hopper-check 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 possibly item sorting systems. @@ -195,7 +195,7 @@ When enabled, the redstone system is replaced by a faster and alternative versio `InventoryMoveItemEvent` doesn't fire 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!** #### mob-spawner-tick-rate -This option lets you configure how often spawners should be ticked. Higher values mean less lag if you have a lot of spawners, but spawners will spawn mobs less often if you increase this. +This option lets you configure how often spawners should be ticked. Higher values mean less lag if you have a lot of spawners, but mobs will spawn less often if you increase this. #### optimize-explosions Setting this to `true` replaces the vanilla explosion algorithm with a faster one, at a cost of slight inaccuracy when calculating explosion damage. This is usually not noticeable. @@ -204,13 +204,13 @@ Setting this to `true` replaces the vanilla explosion algorithm with a faster on Generating treasure maps is extremely expensive and can hang a server if the structure it's trying to locate is outside of your pregenerated world. It's only safe to enable this if you pregenerated your world and set a vanilla world border. #### treasure-maps-return-already-discovered -Default value of this option forces the newly generated maps to look for unexplored structure, which are usually outside of your pregenerated terrain. Setting this to true makes it so maps can lead to the structures that were discovered earlier. If you don't change this to `true` you may experience server hangs or crashes when generating new treasure maps. +Default value of this option forces the newly generated maps to look for unexplored structure, which are usually outside of your pregenerated terrain. Setting this to true makes it so maps can lead to the structures that were discovered earlier. If you don't change this to `true` you may experience the server hanging or crashing when generating new treasure maps. #### grass-spread-tick-rate 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 it being noticeable. #### container-update-tick-rate -Time in ticks between container updates. Increasing this might help if container updates cause issues for you (it rarely happens). Increasing this value makes it easier for players to experience desync when interacting with inventories (ghost items). +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 Time in ticks after which arrows shot by mobs should disappear after hitting something. Players can't pick these up anyway, so you may aswell set this to something like `20`. From a1c30fa97cfaf1a6e78bc5f04f6a6c7061e750d7 Mon Sep 17 00:00:00 2001 From: granny Date: Thu, 4 Mar 2021 01:16:34 -0800 Subject: [PATCH 11/12] common-pitfalls-and-best-practices too --- common-pitfalls-and-best-practices.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common-pitfalls-and-best-practices.md b/common-pitfalls-and-best-practices.md index 43eea4e..34176c0 100644 --- a/common-pitfalls-and-best-practices.md +++ b/common-pitfalls-and-best-practices.md @@ -18,4 +18,6 @@ Shared hosts are usually the cheapest option, and that's for a valid reason. The Datapacks that run commands are extremely laggy. It may not be much with a few players on, but that doesn't scale well with the playercount and will lag your server pretty quickly as you gain players. Datapacks that modify biomes, loot tables, etc are fine. You're better off looking for a plugin alternative. ## Choosing hardware -Don't just go off how much RAM you need. That's basically a non-issue, as you can run 100+ players on less than 16GB RAM with a lot of room to spare (unless you're using questionable plugins that cache unnecessary things). CPU is probably most important piece of the puzzle. You want something that [ranks good on single core performance](https://www.cpubenchmark.net/singleThread.html), as server's main thread runs on just one thread. It's important to note that this does not mean the entirety of the server uses only one thread. Multiple threads are utilised for quite some time now in systems like async chunk loading on paper. You should absolutely avoid HDD drives. Their speeds are simply way too slow to to justify running a server on them, and minecraft is heavy on I/O operations, especially with high viewdistances and higher playercounts. \ No newline at end of file +Don't just go off of how much RAM you need. You should instead focus on what kind of CPU you should use, since the CPU is the most important part of the server. You want something that [ranks good on single core performance](https://www.cpubenchmark.net/singleThread.html), as a server mainly runs on one thread. Multiple threads are utilised for quite some time now in systems like async chunk loading on paper, however. + +You should absolutely avoid HDD drives. Their speeds are simply way too slow to justify running a server on them since minecraft is heavy on I/O operations (especially with high view distances and higher player counts). \ No newline at end of file From fa506b133abcee7005980f1577f43c2ec3d6fcc8 Mon Sep 17 00:00:00 2001 From: granny Date: Thu, 4 Mar 2021 02:49:31 -0800 Subject: [PATCH 12/12] fix headers and add ToC --- README.md | 179 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 106 insertions(+), 73 deletions(-) diff --git a/README.md b/README.md index 8cc3af6..b4aa36d 100644 --- a/README.md +++ b/README.md @@ -7,12 +7,45 @@ WARNING: This version of the guide has an experimental layout that is not yet co Based on [this guide](https://www.spigotmc.org/threads/guide-server-optimization%E2%9A%A1.283181/) and other sources (all of them are linked throughout the guide when relevant). +## Table of Contents +* [Intro](#intro) +* [Preparations](#preparations) + * [Server jar](#server-jar) + * [Map pregen](#map-pregen) +* [Configurations](#configurations) + * [Networking](#networking) + * [server.properties](#serverproperties) + * [purpur.yml](#purpuryml) + * [Chunks](#chunks) + * [spigot.yml](#spigotyml) + * [paper.yml](#paperyml) + * [Mobs](#mobs) + * [bukkit.yml](#bukkityml) + * [spigot.yml](#spigotyml) + * [paper.yml](#paperyml-1) + * [purpur.yml](#purpuryml-1) + * [Misc](#misc) + * [spigot.yml](#spigotyml-1) + * [paper.yml](#paperyml-2) + * [purpur.yml](#purpuryml-2) + * [Helpers](#helpers) + * [paper.yml](#paperyml-3) +* [Java startup flags](#java-startup-flags) +* ["Too good to be true" plugins](#too-good-to-be-true-plugins) + * [Plugins removing ground items](#plugins-removing-ground-items) + * [Mob stacker plugins](#mob-stacker-plugins) + * [Plugins enabling/disabling other plugins](#plugins-enablingdisabling-other-plugins) +* [What's lagging? - measuring performance](#whats-lagging---measuring-performance) + * [mspt](#mspt) + * [timings](#timings) + * [spark](#spark) + ## Intro There will never be a guide that will give you perfect results. Each server has their own needs and limits on how much you can or are willing to sacrifice. Tinkering around with the options to fine tune them to your servers needs is what it's all about. This guide only aims to help you understand what options have impact on performance and what exactly they change. If you think you found inaccurate information within this guide, you're free to open an issue or set up a pull request. -# Preparations +## Preparations -## Server jar +### Server jar Your choice of server software can make a 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. Recommended top picks: @@ -26,25 +59,25 @@ You should stay away from: * Bukkit/Craftbukkit/Spigot - Extremely outdated in terms of performance compared to other server software you have access to. * Any plugin/software that enables/disables/reloads plugins on runtime. See [this section](#plugins-enablingdisabling-other-plugins) to understand why. -## Map pregen +### Map pregen Map pregeneration is one of the most important steps in improving a low-budget server. This helps out servers that are hosted on a shared cpu/single core node the most, since they can't fully utilize async chunk loading. You can use a plugin such as [chunky](https://github.com/pop4959/Chunky) to pregenerate the world. Make sure to set up a world border so your players don't generate new chunks! Note that pregenning can sometimes take hours depending on the radius you set in the pregen plugin. It's key to remember that the overworld, nether and the end have separate world borders that need to be set up for each world. The nether dimension is 8x smaller than the overworld (if not modified with a datapack), so if you set the size wrong your players might end up outside of the world border! **Make sure to set up a vanilla world border (`/worldborder set [radius]`), as it limits certain functionalities such as lookup range for treasure maps that can cause lag spikes.** -# Configurations +## Configurations -## Networking +### Networking -### [`server.properties`] +#### [`server.properties`] -#### network-compression-threshold +##### network-compression-threshold This allows you to set the cap for the size of a packet before the server attempts to compress it. Setting it higher can save some resources at the cost of bandwidth, and setting it to -1 disables it. If your server is in a network with a proxy or on the same machine (with less than 2 ms ping), disabling this (-1) will be beneficial, since internal network speeds can usually handle the additional uncompressed traffic. -### [`purpur.yml`] +#### [`purpur.yml`] -#### use-alternate-keepalive +##### use-alternate-keepalive you can enable purpur's alternate keepalive system so players with bad connection don't get timed out as often. Has known incompatibility with TCPShield. ``` @@ -55,28 +88,28 @@ https://pl3xgaming.github.io/PurpurDocs/Configuration/#use-alternate-keepalive --- -## Chunks +### Chunks -### [`spigot.yml`] +#### [`spigot.yml`] -#### view-distance +##### view-distance View-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 mobs being active, crops and saplings growing, etc. You should set this value in [`spigot.yml`], as it overwrites the one from [`server.properties`] and can be set per-world. This is an option you want to purposefully set low, somewhere around `3` or `4`, because of the existance of `no-tick-view-distance`. -### [`paper.yml`] +#### [`paper.yml`] -#### no-tick-view-distance +##### no-tick-view-distance This option allows you to set the maximum distance in chunks that the players will see. This enables you to have lower `view-distance` and still let players see further. It's important to know that while the chunks beyond actual `view-distance` won't tick, they will still load from your storage, so don't go overboard. `10` is basically maximum of what you should set this to. As of now chunks are sent to the client regardless of their view distance setting, so going on higher values for this option can cause issues for players with slower connections. -#### delay-chunk-unloads-by +##### delay-chunk-unloads-by Lets you configure how long chunks will stay loaded after a player leaves. This helps to not constantly load and unload the same chunks when a player moves back and forth. Too high values can result in way too many chunks being loaded at once. -#### max-auto-save-chunks-per-tick +##### max-auto-save-chunks-per-tick Lets you slow down incremental world saving by spreading the task over time even more for better average performance. You might want to set this higher than `8` with more than 20-30 players. If incremental save can't finish in time then bukkit will automatically save leftover chunks at once and begin the process again. -#### prevent-moving-into-unloaded-chunks +##### prevent-moving-into-unloaded-chunks When enabled, prevents players from moving into unloaded chunks and causing sync loads that bog down the main thread causing lag. The probablility of a player stumbling into an unloaded chunk is higher the lower your view-distance is. -#### entity-per-chunk-save-limit +##### entity-per-chunk-save-limit With the help of this entry you can set limits to how many entities of specified type can be saved. You should provide a limit for each projectile at least to avoid issues with massive amounts of projectiles being saved and your server crashing on loading that. There is an list of all projectiles provided below. Please adjust the limit to your liking. Suggested value for all projectiles is around `10`. You can also add other entities by their type names to that list. ``` entity-per-chunk-save-limit: @@ -99,146 +132,146 @@ entity-per-chunk-save-limit: witherskull: -1 ``` -#### armor-stands-tick +##### armor-stands-tick 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. -#### armor-stands-do-collision-entity-lookups +##### armor-stands-do-collision-entity-lookups Here you can disable armor stand collisions. This will help if you have a lot of armor stands and don't need them colliding with anything. --- -## Mobs +### Mobs -### [`bukkit.yml`] +#### [`bukkit.yml`] -#### spawn-limits +##### spawn-limits When `per-player-mob-spawns` is enabled, the math of limiting mobs is just `[playercount] * [limit]`, where "playercount" is current amount of players on the server. Logically, the smaller the numbers are, the less mobs you're gonna see. Reducing this is a double-edged sword; yes, your server has less work to do, but in some gamemodes natural-spawning mobs are a big part of a gameplay. You can go as low as 20 or less if you adjust `mob-spawn-range` properly. If you are using tuinity, you can set mob limits per world in [`tuinity.yml`]. -#### ticks-per +##### ticks-per This option sets how often (in ticks) the server attempts to spawn certain living entities. Water/ambient mobs do not need to spawn each tick as they don't usually get killed that quickly. As for monsters: Slightly increasing the time between spawns should not impact spawn rates even in mob farms. In most cases all of the values under this option should be higher than `1`. -### [`spigot.yml`] +#### [`spigot.yml`] -#### mob-spawn-range +##### mob-spawn-range Allows you to reduce the range (in chunks) of where mobs will spawn around the player. Depending on your server's gamemode and its playercount you might want to reduce this value along with [`bukkit.yml`]'s `spawn-limits`. -#### entity-activation-range +##### entity-activation-range You can set what distance from the player an entity should be for it to tick (do stuff). Reducing those values helps performance, but may result in irresponsive mobs until the player gets really close to them. -#### entity-tracking-range +##### entity-tracking-range This is distance in blocks from which entities will be visible. Reducing those ranges only saves bandwidth, as entities are still ticked above this range. They just won't be sent to players. If set too low this can cause mobs to seem to appear out of nowhere near a player. -#### tick-inactive-villagers +##### tick-inactive-villagers This allows you to decide if 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. -#### nerf-spawner-mobs +##### nerf-spawner-mobs 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.yml`]. -### [`paper.yml`] +#### [`paper.yml`] -#### despawn-ranges +##### despawn-ranges Lets you adjust entity despawn ranges (in blocks). Lower those values to clear the mobs that are far away from the player faster. You should keep soft range around `30` and adjust hard range to a bit more than your actual view-distance, so mobs don't immediately despawn when the player goes just beyond the point of a chunk being loaded (this works well because of `delay-chunk-unloads-by` in [`paper.yml`]). -#### per-player-mob-spawns +##### per-player-mob-spawns 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 also make the job easier to properly set entity limits, as it makes the math easier. -#### max-entity-collisions +##### max-entity-collisions 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 inablity to push other entities, including players. Value of `2` should be enough in most cases. -#### update-pathfinding-on-block-update +##### update-pathfinding-on-block-update Disabling this will result in less pathfinding being done, increasing performance, but mobs can appear more laggy; They will just passively update their path every 5 ticks (0.25 sec). -#### fix-climbing-bypassing-cramming-rule +##### fix-climbing-bypassing-cramming-rule Enabling this will fix entities not being affected by cramming while climbing. This will prevent absurd amounts of mobs being stacked in small spaces even if they're climbing (spiders). -### [`purpur.yml`] +#### [`purpur.yml`] -#### dont-send-useless-entity-packets +##### dont-send-useless-entity-packets Enabling this option will save you bandwidth by preventing the server from sending empty position change packets (by default the server sends this packet for each entity even if the entity hasn't moved). May cause some issues with plugins that use client-side entities. -#### aggressive-towards-villager-when-lagging +##### aggressive-towards-villager-when-lagging Enabling this will cause zombies to stop targeting villagers if the server is below the tps treshold set with `lagging-threshold` in [`purpur.yml`]. -#### entities-can-use-portals +##### entities-can-use-portals This option can disable portal usage of all entities besides the player. This prevents entities from loading chunks by changing worlds which is handled on the main thread. -#### villager.brain-ticks +##### villager.brain-ticks This option allows you to set how often (in ticks) villager brains (work and poi) will tick. Going higher than `3` is confirmed to make villagers inconsistant/buggy. -#### villager.lobotomize +##### villager.lobotomize Lobotomized villagers are stripped from their AI and only restock their offers every so often. Enabling this will lobotomize villagers that are unable to pathfind to their destination. Freeing them should unlobotomize them. --- -## Misc +### Misc -### [`spigot.yml`] +#### [`spigot.yml`] -#### merge-radius +##### merge-radius 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. -#### hopper-transfer +##### hopper-transfer 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. -#### hopper-check +##### hopper-check 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 possibly item sorting systems. -### [`paper.yml`] +#### [`paper.yml`] -#### alt-item-despawn-rate +##### alt-item-despawn-rate 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. -#### use-faster-eigencraft-redstone +##### use-faster-eigencraft-redstone When enabled, the redstone system is replaced by a faster and alternative version that reduces redundant block updates, lowering the amount of work your server has to do. -#### disable-move-event +##### disable-move-event `InventoryMoveItemEvent` doesn't fire 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!** -#### mob-spawner-tick-rate +##### mob-spawner-tick-rate This option lets you configure how often spawners should be ticked. Higher values mean less lag if you have a lot of spawners, but mobs will spawn less often if you increase this. -#### optimize-explosions +##### optimize-explosions Setting this to `true` replaces the vanilla explosion algorithm with a faster one, at a cost of slight inaccuracy when calculating explosion damage. This is usually not noticeable. -#### enable-treasure-maps +##### enable-treasure-maps Generating treasure maps is extremely expensive and can hang a server if the structure it's trying to locate is outside of your pregenerated world. It's only safe to enable this if you pregenerated your world and set a vanilla world border. -#### treasure-maps-return-already-discovered +##### treasure-maps-return-already-discovered Default value of this option forces the newly generated maps to look for unexplored structure, which are usually outside of your pregenerated terrain. Setting this to true makes it so maps can lead to the structures that were discovered earlier. If you don't change this to `true` you may experience the server hanging or crashing when generating new treasure maps. -#### grass-spread-tick-rate +##### grass-spread-tick-rate 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 it being noticeable. -#### container-update-tick-rate +##### container-update-tick-rate 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 +##### non-player-arrow-despawn-rate Time in ticks after which arrows shot by mobs should disappear after hitting something. Players can't pick these up anyway, so you may aswell set this to something like `20`. -#### creative-arrow-despawn-rate +##### creative-arrow-despawn-rate 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 aswell set this to something like `20`. -### [`purpur.yml`] +#### [`purpur.yml`] -#### disable-treasure-searching +##### disable-treasure-searching Prevents dolphins from performing structure search similiar to treasure maps -#### teleport-if-outside-border +##### teleport-if-outside-border Allows you to teleport the player to the world spawn if they happen to be outside of the world border. Helpful since the vanilla world border is bypassable and the damage it does to the player can be mitigated. --- -## Helpers +### Helpers -### [`paper.yml`] +#### [`paper.yml`] -#### anti-xray +##### anti-xray Enable this to hide ores from x-rayers. For detailed configuration of this feature check out [Stonar96's recommended settings](https://gist.github.com/stonar96/ba18568bd91e5afd590e8038d14e245e). -#### remove-corrupt-tile-entities +##### remove-corrupt-tile-entities Change this to `true` if you're getting your console spammed with errors regarding tile entities. This will remove any tile entities that cause the error instead of ignoring it. -#### nether-ceiling-void-damage-height +##### nether-ceiling-void-damage-height 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`. --- @@ -250,26 +283,26 @@ JVM can be configured to reduce lag spikes caused by big garbage collector tasks ## "Too good to be true" plugins -#### Plugins removing ground items +### Plugins removing ground items Absolutely unnecessary since they can be replaced with [merge radius](#merge-radius) and [alt-item-despawn-rate](#alt-item-despawn-rateenabled) and frankly, they're less configurable than basic server configs. They tend to use more resources scanning and removing items than not removing the items at all. -#### Mob stacker plugins +### Mob stacker plugins It's really hard to justify using one. Stacking naturally spawned entities causes more lag than not stacking them at all due to the server constantly trying to spawn more mobs. The only "acceptable" use case is for spawners on servers with a large amount of spawners. -#### Plugins enabling/disabling other plugins +### Plugins enabling/disabling other plugins Anything that enables or disables plugins on runtime is extremely dangerous. Loading a plugin like that can cause fatal errors with tracking data and disabling a plugin can lead to errors due to removing dependency. The `/reload` command suffers from exact same issues and you can read more about them in [me4502's blog post](https://matthewmiller.dev/blog/problem-with-reload/) ## What's lagging? - measuring performance -#### mspt +### mspt Paper offers a `/mspt` command that will tell you how much time the server took to calculate recent ticks. If the first and second value you see are lower than 50, then congratulations! Your server is not lagging! If the third value is over 50 then it means there was at least 1 tick that took longer. That's completely normal and happens from time to time, so don't panic. -#### timings +### timings Great way to see what might be going on when your server is lagging are timings. Timings is a tool that lets you see exactly what tasks are taking the longest. It's the most basic troubleshooting tool and if you ask for help regarding lag you will most likely be asked for your timings. To get timings of your server you just need to execute the `/timings paste` command and click the link you're provided with. You can share this link with other people to let them help you. It's also easy to misread if you don't know what you're doing. There is a detailed [video tutorial by Aikar](https://www.youtube.com/watch?v=T4J0A9l7bfQ) on how to read them. -#### spark +### spark [Spark](https://github.com/lucko/spark) is a plugin that allows you to profile your servers CPU and memory usage. You can read on how to use it [on its wiki](https://github.com/lucko/spark/wiki/Commands). There's also a guide on how to find the cause of lag spikes [here](https://github.com/lucko/spark/wiki/Finding-the-cause-of-lag-spikes).