Regionized Multithreading in Folia 1.21.4: How We Sustain 20.00 TPS Across 56 Parallel Regions
1. Breaking the Legacy Single-Threaded Main Server Loop
Historically, Minecraft servers executed almost every game mechanic inside a single Main Server Thread. Every 50 milliseconds, one CPU core had to sequentially process entity AI, fluid physics, redstone updates, and block-entities for every player online. Once MSPT crossed 50.0 ms, server TPS degraded — even when 31 other hardware cores sat nearly idle.
2. Lock-Free Regionized World Partitioning
On Aurora Survival 1.21.4, Folia replaces global mutable world lists with isolated spatial Grid Regions separated by unloaded buffer chunks:
- Zero Shared Mutable State: two distant player towns hold disjoint chunk & entity sets and tick simultaneously on separate physical CPU cores without lock contention.
- Dynamic Split & Merge: when players travel toward each other,
TickRegionSchedulerseamlessly merges adjacent regions, then splits them again once players disperse. - Asynchronous Dimension Portals: Nether and End transitions use message-passing queues rather than global
synchronizedbarriers.
Bukkit.getScheduler(). All scheduled work on ice.minecraftix.pro attaches directly to a spatial coordinate (RegionScheduler) or entity owner (EntityScheduler).
3. NUMA & Thread-Pool Pinning on Keflavík EPYC Blades
On IS-KEF-Blade04 (AMD EPYC 9354P), we pin 24 physical cores to regional tick workers, 6 cores to Moonrise/C2ME chunk I/O, and dedicate isolated cores to Netty epoll loops:
threaded-regions:
threads: 24
grid-exponent: 4
merge-radius: 2
chunk-system:
io-threads: 2
worker-threads: 6
gen-parallelism: "on"
packet-limiter:
all-packets:
interval: 7.0
max-packet-rate: 550.0
4. Production Telemetry Results
With 260 concurrent players and 21,000 active entities distributed across 56 active regions, our heaviest region averages 10.9 ms MSPT at a rock-solid 20.00 TPS — enabling a 12-chunk simulation distance and 20-chunk view distance with 100% vanilla redstone timing.