How I Optimized My 8-Person ATM10 Server


How I Optimized My 8-Person ATM10 Server

Hey all!

I started running an All the Mods 10 server for about 8 people, and getting the TPS reined in was a nightmare. However, with quick iteration enabled by the itzg Minecraft image, NixOS, and spark, I got my server in a state where players can fly around and we don’t feel THAT much performance degradation.

Here’s the relevant excerpt from my config:

MEMORY = "16G";
MAX_PLAYERS = "10";
JVM_OPTS = "-XX:+UseZGC -XX:+UseCompactObjectHeaders -XX:SoftMaxHeapSize=13G -XX:ConcGCThreads=2";
ALLOW_FLIGHT = "TRUE";
SIMULATION_DISTANCE = "6";
MAX_TICK_TIME = "-1";
CURSEFORGE_FILES = "distant-horizons,c2me,discord-integration";
MODRINTH_PROJECTS = "proxy-compatible-forge,zfastnoise,lithium,achievements-optimizer,servercore,scalablelux";

MAX_TICK_TIME being set to -1 disables the watchdog. I did this because I noticed ZGC’s GC can exceed the default max tick time threshold, which led to false positive crashes. Not ideal, but it works!

For the JVM args, I started from this list with one modification: telling ZGC to attempt to run the GC before we hit the 16GB limit, so we don’t deal with long stalls.

Distant Horizons does have a bit of a performance penalty, but I found that having the LODs helps obfuscate the dynamic view distance scaling from servercore. Players don’t notice the simulation distance changes.

If you’re running your server behind a Velocity proxy, proxy-compatible-forge was necessary to have that work smoothly. Not a performance enhancement, but excellent for security, and I’d recommend more server hosts do this!

c2me, zfastnoise, lithium, achievements-optimizer, and scalablelux were mostly drop-in optimizations that helped target areas I saw taking up tons of my tick time.

With servercore, I had to do a little bit of configuration to enable the dynamic scaling of mob caps and simulation distance, but honestly it’s practically as simple as enabling a flag.

On security

To expand on the security side of things: my server runs in a rootless Podman container on an Incus VM, and I manage the VMs and the host with NixOps + OpenTofu. Velocity runs on a VPS with the traffic tunneled over WireGuard to my server host.