Difference between revisions of "Server performance guide"
Lord Samosa (talk | contribs) (Replaced content with "Work in progress") Tag: Replaced |
(Added introduction, added Nucleus' pregeneration, added JVM arguments) |
||
Line 1: | Line 1: | ||
− | Work in progress | + | {{#seo: |
+ | |title=Server Performance Guide | ||
+ | |title_mode=replace | ||
+ | |keywords=server, performance, guide, pixelmon, minecraft mod | ||
+ | |description=This page explains how to configure your Pixelmon server performantly. | ||
+ | }} | ||
+ | <!--T:2--> | ||
+ | The following is a guide to performance for [[Pixelmon]] servers. This guide covers world pre-generation, launch Java arguments, recommended settings, commonly encountered issues, and lastly, discusses tools by which you can keep track of your server's performance, including reading and sharing logs. If you are installing Pixelmon on your own server, see the [[Server Installation]] guide instead. | ||
+ | |||
+ | <!--T:8--> | ||
+ | This guide assumes that you understand the basic principles of Minecraft server hosting, and specifically, current Pixelmon server environments, including [https://www.spongepowered.org/ Sponge] and [http://files.minecraftforge.net/ Forge]. If you do not understand these environments, or have never used them (or head of them), we strongly recommend you read our [[Server Installation]] guide first, and if you need further help, please use #server-support in the Pixelmon [[Discord]]. | ||
+ | |||
+ | ==Notes== <!--T:9--> | ||
+ | Pixelmon servers are currently most commonly using [https://www.spongepowered.org/ Sponge] as a plugin environment. Plugins mentioned in this guide can be found on [https://ore.spongepowered.org/ Sponge Ore], a plugin repository. All other plugins mentioned will be have links provided in their description. | ||
+ | |||
+ | == World Pre-generation == <!--T:9--> | ||
+ | ''Please note that this '''cannot''' be avoided. It is of extreme importance for servers to pre-generate their world's chunks as soon as possible.'' | ||
+ | # Find, download and install [https://nucleuspowered.org/ Nucleus], Sponge's leading Essentials-like plugin. | ||
+ | # In your <code>server.properties</code> (located in the server's root folder), set the setting <code>max-tick-time</code> to <code>-1</code>. This will prevent your server from timing out during this process. This setting is used to tweak the Server Watchdog, a Minecraft ‘feature’ that forcefully crashes your server if a single tick takes too long. Disabling it removes the risk of the Watchdog crashing your server while pre-generating. | ||
+ | # If not already the case, whitelist your server and ensure all players have logged off. The process takes a few hours (depending on your server's hardware), and runs smoother if there are no players online. | ||
+ | # Use <code>/world border set [world] [center-x] [center-z] [diameter-in-blocks]</code>, replacing each variable with the desired configuration. The bigger the <code>[diameter-in-blocks]</code>, the bigger the border, the bigger the map, the longer the pre-generating process will take. Once you have decided on your border's size, add 2000 blocks more to its count. If you want <code>15000</code>, then <code>17000</code> will be your border size for pregenerating. | ||
+ | ## The desired choice will vastly depend on your particular case. For starting, public servers, we recommend anything between <code>15000</code> and <code>20000</code>. | ||
+ | ## In general, anything above 30K in diameter will be a difficult to manage, as worlds of that size can go upwards of 50GB after 10 months of use. | ||
+ | ## This pre-generation process has to be repeated for every world that will be used by players. Vanilla Pixelmon servers have 4 by default - overworld, DIM-1, DIM1, and ultraspace. Note, each world can have it's own specific size, but all will weigh heavily on disk space. | ||
+ | ## When deciding your world's size, please take into account the need for fast, reliable and varied backups. Most servers will need at least one current, zipped backup of the world folder, as a safety net. | ||
+ | # Use <code>/world border gen [world]</code> to start pre-generating. You will see messages in console indicating the progress. Don't worry, it'll stop once it reaches your border, so you can basically leave your server until it is done. | ||
+ | ## To speed-up the process, you can use the <code>-a</code> flag in the pre-generation command to turn on 'agressive' mode. This will usually allow pre-generation to move along faster, but it can also severely immobilize the server. We do not recommend usig this flag if you have players online. To use, insert the flag like so, <code> /world border gen -a [world]</code>. | ||
+ | ## You can also increase save time to accelerate the generation process, it will however imply you will lose more time if the server ends up crashing. For example, <code>/world border gen --save 5m [world]</code>. You can combine this with the <code-a</code> flag to generate at the fastest rate possible. | ||
+ | # Expect the pre-generating process to take a '''long''' time. Make yourself a coffee, or two, or three. Wait. | ||
+ | # Once the completion message is show in console, you will need to use <code>/world border set [world] [center-x] [center-z] [diameter-in-blocks]</code> again. This time however, the <code>[diameter-in-blocks]</code> will be your initial size, without the additional buffer recommended above. This will prevent players at the border from generating past it, and act as a buffer to ensure no more generation takes place. | ||
+ | # Use Minecraft's [https://minecraft.gamepedia.com/World_border#Commands native world border] damage command, <code>/worldborder damage buffer <sizeInBlocks></code>, to turn on world border damage higher than default. | ||
+ | # Repeat steps 2 through 8 for every existing world. | ||
+ | # Once you are done, go back to your <code>server.properties</code> and set the <code>max-tick-time</code> to <code>18000</code>. This re-enabled Minecraft's native Watchdog, ensuring that if your server stalls because of a leak, it will crash and not remain frozen without recovery. | ||
+ | |||
+ | == Java Launch Arguments == <!--T:9--> | ||
+ | # In our [[Server Installation]] guide, we covered <code>start.bat</code> scripts. In that script, replace with the following: | ||
+ | java -Xms6G -Xmx6G -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=100 -XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:G1MixedGCLiveThresholdPercent=50 -XX:+AlwaysPreTouch -jar server.jar | ||
+ | # Replace <code>server.jar</code> with your running jar. For example, if running a Forge server, your running jar is named similarly to <code>forge-1.12.2-14.23.5.2838-universal.jar</code>. | ||
+ | # Most Pixelmon servers will need at the bare minimum 4GB of RAM to run properly. Processes like pre-generation can exacerbate memory problems, which is why it should be done before your server's launch. The more players you have online, the more 'heavy' your server will be, so plan accordingly. For the average server with a small player-base, 6GB of RAM will suffice. | ||
+ | ## More RAM does not mean more performance. In fact, on the contrary - it will worsen Java's garbage collection. Do '''not''' assign over 14GB, unless otherwise indicated by your particular circumstances and hosting experience. | ||
+ | ## For a longer, and more technical read on Java launch arguments, we recommend studying [https://forums.spongepowered.org/t/optimized-startup-flags-for-consistent-garbage-collection/13239 Aikar's Garbage Collection guide], which applies to Forge, Sponge and Spigot environments alike. | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ''Work in progress'' |
Revision as of 00:52, 26 July 2020
The following is a guide to performance for Pixelmon servers. This guide covers world pre-generation, launch Java arguments, recommended settings, commonly encountered issues, and lastly, discusses tools by which you can keep track of your server's performance, including reading and sharing logs. If you are installing Pixelmon on your own server, see the Server Installation guide instead.
This guide assumes that you understand the basic principles of Minecraft server hosting, and specifically, current Pixelmon server environments, including Sponge and Forge. If you do not understand these environments, or have never used them (or head of them), we strongly recommend you read our Server Installation guide first, and if you need further help, please use #server-support in the Pixelmon Discord.
Notes
Pixelmon servers are currently most commonly using Sponge as a plugin environment. Plugins mentioned in this guide can be found on Sponge Ore, a plugin repository. All other plugins mentioned will be have links provided in their description.
World Pre-generation
Please note that this cannot be avoided. It is of extreme importance for servers to pre-generate their world's chunks as soon as possible.
- Find, download and install Nucleus, Sponge's leading Essentials-like plugin.
- In your
server.properties
(located in the server's root folder), set the settingmax-tick-time
to-1
. This will prevent your server from timing out during this process. This setting is used to tweak the Server Watchdog, a Minecraft ‘feature’ that forcefully crashes your server if a single tick takes too long. Disabling it removes the risk of the Watchdog crashing your server while pre-generating. - If not already the case, whitelist your server and ensure all players have logged off. The process takes a few hours (depending on your server's hardware), and runs smoother if there are no players online.
- Use
/world border set [world] [center-x] [center-z] [diameter-in-blocks]
, replacing each variable with the desired configuration. The bigger the[diameter-in-blocks]
, the bigger the border, the bigger the map, the longer the pre-generating process will take. Once you have decided on your border's size, add 2000 blocks more to its count. If you want15000
, then17000
will be your border size for pregenerating.- The desired choice will vastly depend on your particular case. For starting, public servers, we recommend anything between
15000
and20000
. - In general, anything above 30K in diameter will be a difficult to manage, as worlds of that size can go upwards of 50GB after 10 months of use.
- This pre-generation process has to be repeated for every world that will be used by players. Vanilla Pixelmon servers have 4 by default - overworld, DIM-1, DIM1, and ultraspace. Note, each world can have it's own specific size, but all will weigh heavily on disk space.
- When deciding your world's size, please take into account the need for fast, reliable and varied backups. Most servers will need at least one current, zipped backup of the world folder, as a safety net.
- The desired choice will vastly depend on your particular case. For starting, public servers, we recommend anything between
- Use
/world border gen [world]
to start pre-generating. You will see messages in console indicating the progress. Don't worry, it'll stop once it reaches your border, so you can basically leave your server until it is done.- To speed-up the process, you can use the
-a
flag in the pre-generation command to turn on 'agressive' mode. This will usually allow pre-generation to move along faster, but it can also severely immobilize the server. We do not recommend usig this flag if you have players online. To use, insert the flag like so,/world border gen -a [world]
. - You can also increase save time to accelerate the generation process, it will however imply you will lose more time if the server ends up crashing. For example,
/world border gen --save 5m [world]
. You can combine this with the <code-a flag to generate at the fastest rate possible.
- To speed-up the process, you can use the
- Expect the pre-generating process to take a long time. Make yourself a coffee, or two, or three. Wait.
- Once the completion message is show in console, you will need to use
/world border set [world] [center-x] [center-z] [diameter-in-blocks]
again. This time however, the[diameter-in-blocks]
will be your initial size, without the additional buffer recommended above. This will prevent players at the border from generating past it, and act as a buffer to ensure no more generation takes place. - Use Minecraft's native world border damage command,
/worldborder damage buffer <sizeInBlocks>
, to turn on world border damage higher than default. - Repeat steps 2 through 8 for every existing world.
- Once you are done, go back to your
server.properties
and set themax-tick-time
to18000
. This re-enabled Minecraft's native Watchdog, ensuring that if your server stalls because of a leak, it will crash and not remain frozen without recovery.
Java Launch Arguments
- In our Server Installation guide, we covered
start.bat
scripts. In that script, replace with the following:
java -Xms6G -Xmx6G -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=100 -XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:G1MixedGCLiveThresholdPercent=50 -XX:+AlwaysPreTouch -jar server.jar
- Replace
server.jar
with your running jar. For example, if running a Forge server, your running jar is named similarly toforge-1.12.2-14.23.5.2838-universal.jar
. - Most Pixelmon servers will need at the bare minimum 4GB of RAM to run properly. Processes like pre-generation can exacerbate memory problems, which is why it should be done before your server's launch. The more players you have online, the more 'heavy' your server will be, so plan accordingly. For the average server with a small player-base, 6GB of RAM will suffice.
- More RAM does not mean more performance. In fact, on the contrary - it will worsen Java's garbage collection. Do not assign over 14GB, unless otherwise indicated by your particular circumstances and hosting experience.
- For a longer, and more technical read on Java launch arguments, we recommend studying Aikar's Garbage Collection guide, which applies to Forge, Sponge and Spigot environments alike.
Work in progress