How to optimize your Modded Minecraft server
In this guide, we'll see some methods to profile your server performance, some optimization mods that can make a huge difference in your server's performance, and some tips you can follow to say "bye-bye" to lag issues. This is aimed to be the easiest to understand, complete while remaining simple, and accurate guide for modded servers optimization.
In order to determine the best way to fix performance issues, first, we have to know what's exactly causing those problems.
Some methods to profile your server performance:
Spark: Spark is a server-side (optional on the client) lightweight mod that can be used to profile your server CPU, inspect the RAM Memory usage, and create timing reports of your server. You can check on Spark's Modrinth or CurseForge Pages to see what versions are supported. This is the only stable method as of now that's available for Fabric, Forge & NeoForge.
SpongeForge : Sponge itself is a server-side software that allows you to use Sponge plugins & Forge mods at the same time, but that isn't everything! Sponge also has its own Timings report function integrated. It is available on Forge 1.8-1.12.2, 1.16.5, 1.19.4, and 1.20.1. If you don't know how to install Sponge, you can follow this YouTube Tutorial.
Mohist: It allows you to use Bukkit/Spigot/Paper plugins & Forge mods at the same time. It also includes many performance patches and has the same Timings report profiling tool. It is available for 1.12.2, 1.16.5, 1.18.2, 1.19.2, 1.19.4 and 1.20-1.20.2.
Note: Even though all of these 3 last software (Sponge/Magma/Mohist) are mostly stable, mods and plugins were never meant to work together. In case you have any issues related to using any of the software above, just open a ticket and we'll help you out!
Using Spark : Spark has many useful features to profile different types of performance issues. However, what we'll be focussing on in this article is their Timings profiler since it's the tool that can be used to determine lag sources in at least 90% of the situations. Once you've installed Spark on your server, you'll have to start the Performance profiler by running the command spark profiler. Once you've done this you'll have to run the command spark profiler --stop.
Pro Tip: You can also just run spark profiler –timeout <number> to stop the profiler automatically after <number> of seconds!
After running the command, the server will return a link to the profile site where you'll be able to check exactly what's causing any tick usage and with this, what's probably causing the most lag on your server.
Using Sponge/Magma/Mohist : These 3 methods have a very similar timings profiler tool. In fact, they're all based on the same software (Timings v2 by Aikar), the only difference is the command used to get the reports. In order to get your timings report when using Sponge, you'll have to run the command sponge timings on, then wait (ideally) between 5 and 15 minutes (The longer you leave it active, the more accurate the result will be), and then you'll have to run the command sponge timings paste or sponge timings report. After running the command, you'll get a link to the timings report site.
The process is very similar on Mohist, you'll have to run the command timings on, wait a couple of minutes, and then run the command timings paste or timings report.
Once you access the timings report site, you'll be able to see a lot of useful information, such as the uptime, the usage of your server garbage collector, a list of your plugins, the tick usage of each server process, and more.
If you're unsure of how to read your timing reports, do not hesitate to make a ticket and we'll for sure help you out!
Sometimes, the best way to optimize your server is to simply download and drag-drop a mod. As simple as that! In this section, we'll see some of the best optimization mods out there for the most used Modded versions of Minecraft and we'll briefly explain why they're so good.
Note: All of these mods should be fully compatible with each other while using the same version of Minecraft and the same modloader (E.g: Forge or Fabric).
Lithium: Lithium is what's called a "general-purpose optimization mod" because it helps to improve a lot of systems without making major changes to vanilla behaviours. This means that there's literally no reason to not use it since it won't have any negative impact on your gameplay! Lithium can be used both on the server-side and the client-side without being required to have it installed on both. It doesn't have any dependency, so you just have to download and drag-drop it on your mods folder.
FerriteCore: FerriteCore has so many patches that would be really difficult to number them. However, an extremely simple explanation of what this mod does is "It helps your server to keep its RAM usage as low as possible". It has a very significant impact on huge modded servers, however, it can help to decrease the RAM usage in the "long-term" (Servers that have to run for many hours without restarting) for small servers too. FerriteCore can be used both on the server-side and the client-side without being required to have it installed on both. It doesn't have any dependency.
Phosphor: Phosphor was made to optimize one of the most inefficient areas of Minecraft. The lighting engine of the game. When using Phosphor you'll instantly notice how the chunks generation becomes a lot faster. Phosphor can be installed both on the server-side and the client-side without being required to have it installed on both. It doesn't have any dependency. However, Phosphor cannot be installed with Starlight, as they are incompatible with one another and the mod is only supported up to Fabric 1.19.4.
Starlight: Startlight is a mod that rewrites the light engine to fix lighting performance and lighting errors. Starlight can be installed either on the dedicated server or client. It is not required to be installed on both sides. However, Starlight cannot be installed with Phosphor, as they are incompatible with one another and the mod is only supported up to Fabric 1.20.4.
Audaki Cart Engine: Audaki Cart Engine offers well designed and properly balanced, competitive and viable cart-based passenger transportation. The mod is currently a huge overhaul of the vanilla minecart code to support higher speeds (up to 34m/s) while still supporting existing lines with curves, ascending and descending rail pieces are no problem. A lot of stuff was also tweaked so tha the powered rails required to reach certain speeds is well balanced, so creating a high-speed railway is actually a proper end-game goal.
Concurrent Chunk Management Engine: Concurrent Chunk Management Engine is a Fabric mod designed to improve the performance of chunk generation, I/O, and loading. This is done by taking advantage of multiple CPU cores in parallel. For the best performance it is recommended to use C2ME with Lithium and Starlight. However, the mod is currently in Alpha stage and pretty experimental so we recommend taking regular backups when using the mod.
Krypton: Krypton is a Fabric mod that attempts to optimize the Minecraft networking stack. It includes several optimizations such as highly optimized Netty handlers, Flush consolidation, and micro-organizations that reduce memory usage and improve packet serialization speeds.
Memory Leak Fix: Memory Leak Fix is a mod that fixes random memory leaks. For the best performance it is recommended to use Memory Leak Fix with Lithium and FerriteCore.
FerriteCore: It has the same/very similar features as the mod's Fabric equivalent.
AI Improvements: AI Improvements is a mod that focuses on optimizing the AI of Mobs/Animals with nearly 0 modifications of how they work in-game. This mod has a major effect on servers with a lot of mobs active at the same time and can help to increase the overall performance in huge servers by removing simple vanilla tasks and replacing them with optimized tasks handled by the mod. AI Improvements is a server-side mod so it isn't required to be installed on the client. It doesn't have any dependency so you just have to drag-drop it on your mods folder!
Lithium: It has the same/very similar features as the mod's Fabric 1.17+ equivalent.
FerriteCore: It has the same/very similar features as the mod's Fabric 1.17+ equivalent.
Phosphor: It has the same/very similar features as the mod's Fabric 1.17+ equivalent.
Krypton: It has the same/very similar features as the mod's Fabric 1.17+ equivalent.
Memory Leak Fix: It has the same/very similar features as the mod's Fabric 1.17+ equivalent.
FerriteCore: It has the same/very similar features as the mod's Fabric 1.17+ equivalent.
Phosphor: It has the same/very similar features as the mod's Fabric 1.17+ equivalent.
AI Improvements: It has the same/very similar features as the mod's Forge 1.17+ equivalent.
Performant: Performant is a multi-purpose optimization mod that helps to improve many game mechanics such as AI overhead, multithread entity collisions, and more! Performant can be used both on the server-side and the client-side without being required to be installed on both. It doesn't have any dependency so once you download it is ready to drag-drop it on your mods folder and enjoy your improved server performance!
AI Improvements: It has the same/very similar features as the mod's Forge 1.17+ equivalent.
Phosphor: It's slightly slower than the mod's Fabric 1.17+ equivalent., however, it's still highly recommended to improve chunk-loader performance and to fix/improve the vanilla light engine.
BetterFPS: From all of the mods listed, this is probably the least useful on servers. This mod is mostly meant for the client-side; however, it includes some server-side optimizations such as the "fast hopper" implementation which improves the overall performance of hoppers on the server.
It's recommended to be used both on the server-side and the client-side. It doesn't require any dependency.
FoamFix: This mod focuses on optimizing the Java heap usage, which helps to decrease the RAM usage, especially for large servers. Note that it has some incompatibilities with Sponge & Magma (And possibly with Mohist too) so it's not recommended to install it if you use one of these 2 software on your server. FoamFix can be installed both on the server-side and the client-side without being required to be installed on both. It doesn't have any dependency; however, it's not recommended to be used on servers under 1.12.2.
FastCraft: FastCraft is one of those mods that don't focus on just one thing but can help a lot even if you don't notice it. It has features and improvements to reduce the RAM usage and make the chunk loading a lot faster. FastCraft can be used both on the server-side and the client-side without being required to be installed on both. It doesn't have any dependency, however, the mod is not compatible with FoamFix, so in case you've got FoamFix installed, it's recommended to replace it for FastCraft.
BetterFPS: It has the same/very similar features as the mod's Forge 1.12.2 equivalent. and will probably not perform as well as its newer version, however, it's still recommended to be used.
Note: If you want to use more performance mods, You can also check this list of Performance mods for each major version of Minecraft Forge and Fabric.
Even though adding the mods listed above should improve the performance by a ton and they even may seem to do magic on your server, there are always some things that these mods can't or are unable to fix. Here we'll be talking about how to detect and fix some external performance issues using the tools that we've already talked about, some vanilla configurations, and also using some extra mods that may not be considered as "optimization mods".
World Pre-generation
Did you know that Chunk Generation is one of the heaviest things on Minecraft servers? Because of this, pre-generate your world should be one of the top priority things to do if you want to keep a good server performance. Especially on the latest versions because of how many changes the world generation experienced since 1.13 (For an idea, Minecraft 1.18 Worlds became 50% bigger compared to the versions before).
The pre-generation process on Minecraft servers context can be basically explained as "the way you make your server generate chunks before a player even access them". Pre-generate an important part of your world is key when it comes to optimizing servers because once you generate a chunk for the first time, the server no longer needs to generate it after a player goes back to that chunk, which is a big deal because the original chunk generation, as mentioned, is one of the heaviest parts of the game.
Pre-generation not only helps to prevent some of the heaviest processes on Minecraft servers, but it also helps with the Chunk Load speed on the client-side, which I guess nobody would complain about.
You can use the Chunky Mod to pre-generate a part of your Minecraft Modded World efficiently and safely. You can follow this Chunky Knowledge Base Article on how you can use the Chunky mod.
If you require any further assistance, please create a ticket here.
Created By: Alecz R
Profiling your server performance
In order to determine the best way to fix performance issues, first, we have to know what's exactly causing those problems.
Some methods to profile your server performance:
Spark: Spark is a server-side (optional on the client) lightweight mod that can be used to profile your server CPU, inspect the RAM Memory usage, and create timing reports of your server. You can check on Spark's Modrinth or CurseForge Pages to see what versions are supported. This is the only stable method as of now that's available for Fabric, Forge & NeoForge.
SpongeForge : Sponge itself is a server-side software that allows you to use Sponge plugins & Forge mods at the same time, but that isn't everything! Sponge also has its own Timings report function integrated. It is available on Forge 1.8-1.12.2, 1.16.5, 1.19.4, and 1.20.1. If you don't know how to install Sponge, you can follow this YouTube Tutorial.
Mohist: It allows you to use Bukkit/Spigot/Paper plugins & Forge mods at the same time. It also includes many performance patches and has the same Timings report profiling tool. It is available for 1.12.2, 1.16.5, 1.18.2, 1.19.2, 1.19.4 and 1.20-1.20.2.
Note: Even though all of these 3 last software (Sponge/Magma/Mohist) are mostly stable, mods and plugins were never meant to work together. In case you have any issues related to using any of the software above, just open a ticket and we'll help you out!
How to profile your server performance using these methods
Using Spark : Spark has many useful features to profile different types of performance issues. However, what we'll be focussing on in this article is their Timings profiler since it's the tool that can be used to determine lag sources in at least 90% of the situations. Once you've installed Spark on your server, you'll have to start the Performance profiler by running the command spark profiler. Once you've done this you'll have to run the command spark profiler --stop.
Pro Tip: You can also just run spark profiler –timeout <number> to stop the profiler automatically after <number> of seconds!
After running the command, the server will return a link to the profile site where you'll be able to check exactly what's causing any tick usage and with this, what's probably causing the most lag on your server.
Using Sponge/Magma/Mohist : These 3 methods have a very similar timings profiler tool. In fact, they're all based on the same software (Timings v2 by Aikar), the only difference is the command used to get the reports. In order to get your timings report when using Sponge, you'll have to run the command sponge timings on, then wait (ideally) between 5 and 15 minutes (The longer you leave it active, the more accurate the result will be), and then you'll have to run the command sponge timings paste or sponge timings report. After running the command, you'll get a link to the timings report site.
The process is very similar on Mohist, you'll have to run the command timings on, wait a couple of minutes, and then run the command timings paste or timings report.
Once you access the timings report site, you'll be able to see a lot of useful information, such as the uptime, the usage of your server garbage collector, a list of your plugins, the tick usage of each server process, and more.
If you're unsure of how to read your timing reports, do not hesitate to make a ticket and we'll for sure help you out!
Recommended optimization mods for your server
Sometimes, the best way to optimize your server is to simply download and drag-drop a mod. As simple as that! In this section, we'll see some of the best optimization mods out there for the most used Modded versions of Minecraft and we'll briefly explain why they're so good.
Note: All of these mods should be fully compatible with each other while using the same version of Minecraft and the same modloader (E.g: Forge or Fabric).
Minecraft 1.17 and above
Fabric Mod Loader:
Lithium: Lithium is what's called a "general-purpose optimization mod" because it helps to improve a lot of systems without making major changes to vanilla behaviours. This means that there's literally no reason to not use it since it won't have any negative impact on your gameplay! Lithium can be used both on the server-side and the client-side without being required to have it installed on both. It doesn't have any dependency, so you just have to download and drag-drop it on your mods folder.
FerriteCore: FerriteCore has so many patches that would be really difficult to number them. However, an extremely simple explanation of what this mod does is "It helps your server to keep its RAM usage as low as possible". It has a very significant impact on huge modded servers, however, it can help to decrease the RAM usage in the "long-term" (Servers that have to run for many hours without restarting) for small servers too. FerriteCore can be used both on the server-side and the client-side without being required to have it installed on both. It doesn't have any dependency.
Phosphor: Phosphor was made to optimize one of the most inefficient areas of Minecraft. The lighting engine of the game. When using Phosphor you'll instantly notice how the chunks generation becomes a lot faster. Phosphor can be installed both on the server-side and the client-side without being required to have it installed on both. It doesn't have any dependency. However, Phosphor cannot be installed with Starlight, as they are incompatible with one another and the mod is only supported up to Fabric 1.19.4.
Starlight: Startlight is a mod that rewrites the light engine to fix lighting performance and lighting errors. Starlight can be installed either on the dedicated server or client. It is not required to be installed on both sides. However, Starlight cannot be installed with Phosphor, as they are incompatible with one another and the mod is only supported up to Fabric 1.20.4.
Audaki Cart Engine: Audaki Cart Engine offers well designed and properly balanced, competitive and viable cart-based passenger transportation. The mod is currently a huge overhaul of the vanilla minecart code to support higher speeds (up to 34m/s) while still supporting existing lines with curves, ascending and descending rail pieces are no problem. A lot of stuff was also tweaked so tha the powered rails required to reach certain speeds is well balanced, so creating a high-speed railway is actually a proper end-game goal.
Concurrent Chunk Management Engine: Concurrent Chunk Management Engine is a Fabric mod designed to improve the performance of chunk generation, I/O, and loading. This is done by taking advantage of multiple CPU cores in parallel. For the best performance it is recommended to use C2ME with Lithium and Starlight. However, the mod is currently in Alpha stage and pretty experimental so we recommend taking regular backups when using the mod.
Krypton: Krypton is a Fabric mod that attempts to optimize the Minecraft networking stack. It includes several optimizations such as highly optimized Netty handlers, Flush consolidation, and micro-organizations that reduce memory usage and improve packet serialization speeds.
Memory Leak Fix: Memory Leak Fix is a mod that fixes random memory leaks. For the best performance it is recommended to use Memory Leak Fix with Lithium and FerriteCore.
Forge Mod Loader:
FerriteCore: It has the same/very similar features as the mod's Fabric equivalent.
AI Improvements: AI Improvements is a mod that focuses on optimizing the AI of Mobs/Animals with nearly 0 modifications of how they work in-game. This mod has a major effect on servers with a lot of mobs active at the same time and can help to increase the overall performance in huge servers by removing simple vanilla tasks and replacing them with optimized tasks handled by the mod. AI Improvements is a server-side mod so it isn't required to be installed on the client. It doesn't have any dependency so you just have to drag-drop it on your mods folder!
Minecraft 1.16.5
Fabric Mod Loader:
Lithium: It has the same/very similar features as the mod's Fabric 1.17+ equivalent.
FerriteCore: It has the same/very similar features as the mod's Fabric 1.17+ equivalent.
Phosphor: It has the same/very similar features as the mod's Fabric 1.17+ equivalent.
Krypton: It has the same/very similar features as the mod's Fabric 1.17+ equivalent.
Memory Leak Fix: It has the same/very similar features as the mod's Fabric 1.17+ equivalent.
Forge Mod Loader:
FerriteCore: It has the same/very similar features as the mod's Fabric 1.17+ equivalent.
Phosphor: It has the same/very similar features as the mod's Fabric 1.17+ equivalent.
AI Improvements: It has the same/very similar features as the mod's Forge 1.17+ equivalent.
Performant: Performant is a multi-purpose optimization mod that helps to improve many game mechanics such as AI overhead, multithread entity collisions, and more! Performant can be used both on the server-side and the client-side without being required to be installed on both. It doesn't have any dependency so once you download it is ready to drag-drop it on your mods folder and enjoy your improved server performance!
Minecraft 1.12.2
Forge Mod Loader:
AI Improvements: It has the same/very similar features as the mod's Forge 1.17+ equivalent.
Phosphor: It's slightly slower than the mod's Fabric 1.17+ equivalent., however, it's still highly recommended to improve chunk-loader performance and to fix/improve the vanilla light engine.
BetterFPS: From all of the mods listed, this is probably the least useful on servers. This mod is mostly meant for the client-side; however, it includes some server-side optimizations such as the "fast hopper" implementation which improves the overall performance of hoppers on the server.
It's recommended to be used both on the server-side and the client-side. It doesn't require any dependency.
FoamFix: This mod focuses on optimizing the Java heap usage, which helps to decrease the RAM usage, especially for large servers. Note that it has some incompatibilities with Sponge & Magma (And possibly with Mohist too) so it's not recommended to install it if you use one of these 2 software on your server. FoamFix can be installed both on the server-side and the client-side without being required to be installed on both. It doesn't have any dependency; however, it's not recommended to be used on servers under 1.12.2.
Minecraft 1.7.10
Forge Mod Loader:
FastCraft: FastCraft is one of those mods that don't focus on just one thing but can help a lot even if you don't notice it. It has features and improvements to reduce the RAM usage and make the chunk loading a lot faster. FastCraft can be used both on the server-side and the client-side without being required to be installed on both. It doesn't have any dependency, however, the mod is not compatible with FoamFix, so in case you've got FoamFix installed, it's recommended to replace it for FastCraft.
BetterFPS: It has the same/very similar features as the mod's Forge 1.12.2 equivalent. and will probably not perform as well as its newer version, however, it's still recommended to be used.
Note: If you want to use more performance mods, You can also check this list of Performance mods for each major version of Minecraft Forge and Fabric.
Other ways to optimize your server
Even though adding the mods listed above should improve the performance by a ton and they even may seem to do magic on your server, there are always some things that these mods can't or are unable to fix. Here we'll be talking about how to detect and fix some external performance issues using the tools that we've already talked about, some vanilla configurations, and also using some extra mods that may not be considered as "optimization mods".
World Pre-generation
Did you know that Chunk Generation is one of the heaviest things on Minecraft servers? Because of this, pre-generate your world should be one of the top priority things to do if you want to keep a good server performance. Especially on the latest versions because of how many changes the world generation experienced since 1.13 (For an idea, Minecraft 1.18 Worlds became 50% bigger compared to the versions before).
But first of all, what does "pre-generation" means in this context?
The pre-generation process on Minecraft servers context can be basically explained as "the way you make your server generate chunks before a player even access them". Pre-generate an important part of your world is key when it comes to optimizing servers because once you generate a chunk for the first time, the server no longer needs to generate it after a player goes back to that chunk, which is a big deal because the original chunk generation, as mentioned, is one of the heaviest parts of the game.
Pre-generation not only helps to prevent some of the heaviest processes on Minecraft servers, but it also helps with the Chunk Load speed on the client-side, which I guess nobody would complain about.
How can I pre-generate a part of my world on a modded server?
You can use the Chunky Mod to pre-generate a part of your Minecraft Modded World efficiently and safely. You can follow this Chunky Knowledge Base Article on how you can use the Chunky mod.
If you require any further assistance, please create a ticket here.
Created By: Alecz R
Updated on: 18/07/2024
Thank you!