Articles on: Minecraft

How to optimize your Minecraft modded 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.

Disclaimer: This article is based 100% on my own personal experience after managing hundreds of modded servers for our customers, so your opinion can differ from mine. Feel free to contact me (Martín R.) via discord or send me an email (martin.r@sparked.support) if you have any suggestions or doubts about this article!


Table of Contents



Profiling your server performance
How to profile your server performance using these methods
Recommended optimization mods for your server
Minecraft 1.17.1/1.18.2/1.19
Minecraft 1.16.5
Minecraft 1.12.2
Minecraft 1.7.10
Other ways to optimize your server


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. Spark is available for the following versions [Forge 1.7.10 | Forge 1.12.2 | Forge 1.15.2 | Forge 1.16.4/5 | Forge 1.17 | Forge 1.18 | Forge 1.19 | Fabric 1.15.2 | Fabric 1.16.4/5 | Fabric 1.17 | Fabric 1.18 | Fabric 1.19 ]. This is the only stable method as of now that's available for Fabric & Forge.

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. If you don't know how to install Sponge, you can follow this tutorial.

Magma: Magma and Sponge are very similar, Magma is a server-side software that allows you to use Bukkit/Spigot/Paper plugins & Forge mods at the same time. I personally prefer it over Sponge because it has support for more plugins, and adds many performance patches to your server! What makes Magma useful to profile your server performance is that it adds the same tool as Sponge for Timings report, which is extremely useful. Magma is available for 1.12.2, 1.16.5, and 1.18.2, however, we only recommend using it for 1.12.2 for now.

Mohist: The same story as Magma, 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, and 1.18.2, however, we only recommend using it for 1.16.5 for now.

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 Magma and 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).

Minecraft 1.17.1/1.18.2/1.19



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.

Forge Mod Loader:

FerriteCore: It has the same/very similar features as Fabric on Forge.

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 1.17.1 on 1.16.5.

FerriteCore: It has the same/very similar features as 1.17.1 on 1.16.5.

Phosphor: It has the same/very similar features as 1.17.1 on 1.16.5.

Forge Mod Loader:

FerriteCore: It has the same/very similar features as 1.17.1 on 1.16.5.

AI Improvements: It has the same/very similar features as 1.17.1 on 1.16.5.

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 1.17.1/1.16.5 on 1.12.2.

Phosphor: It's slightly slower than its 1.16.5 version, 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, it won't work with FoamFix, so in case you've got FoamFix installed, it's recommended to replace it for FastCraft.

BetterFPS: It has similar features as its 1.12.2 version and will probably not perform as well as its newer version, however, it's still recommended to be used.

Honorific mentions

Starlight [Forge] [Fabric]: Starlight it's the "stereoidic" version of Phosphor, it's a mod that rewrites the Minecraft lighting engine making massives performance improvement, but, at what cost? what makes this mod be in the honorific mentions and not in the list above? Starlight's code is very aggressive in the way it interacts with the lighting engine, which means that it has really high chances to break other mods that modify in any way the lighting engine or have any kind of rendering system, so, you may want to try it out if you really want to have the best performance possible in your server, however, for big modpacks, I'd recommend using Phosphor instead, which may not be as fast as Starlight, but it's a lot more compatible with other mods and still has a huge performance impact. By the way, did I mention that it's completely incompatible with Phosphor?

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?

Thankfully, there are several ways to pre-generate chunks, but probably the most efficient ones for modded servers involve some kind of Chunk-loader or pre-generator mod. These are some of the mods available on this topic, I've also included very basic instructions to pre-generate your world. Make sure to check out their CurseForge pages to learn more about how they work and what other commands are available when using them:

Chunk-Pregenetator [Forge]: It is available on Forge 1.4 | 1.7 | 1.8 | 1.10 | 1.12 | 1.14 | 1.15 | 1.16, so pretty much on all of the most popular versions of Forge! To execute a pre-generation task with ChunkPregenerator, you can run the command "pregen start gen radius EXAMPLE SQUARE 0 0 125", which would pre-generate a square area of 125 Chunks (4000 blocks) considering the chunk that's located at the X: 0, Z: 0 coordinates as its center. Note that 1 Chunk equals an area of 16x16 blocks.

World Pre Generator [Forge]: This mod was made for modern Minecraft versions, which means that it's available from 1.14.4 to 1.18.1 as of now. To pre-generate a part of your world with this mod you can run the command "pregen start 0 0 125 minecraft:overworld", this would pre-generate a 125 chunks (4000 blocks) area considering the chunk that's located at the X: 0, Z: 0 coordinates in the minecraft:overworld dimension as the pre-generation center.

Chunky Pregenerator [Fabric]: Chunky Pregenerator is probably the mod-to-go if you use Fabric, it's easy to use, simple, and efficient. To start a pre-generation task with this mod you can run the following commands. "chunky radius 4000" + "chunky start", the first command sets the radius in blocks (Not Chunks like the other 2 mods), and the second command simply starts the pre-generation process.


If you require any further assistance, please create a ticket here.


Created By: Martín R

Updated on: 01/10/2024

Was this article helpful?

Share your feedback

Cancel

Thank you!