What a stress test tells you
A stress test connects bots to your server in steps and records how tick time grows with each step. The result is a player count your server can hold, and a profile that shows what limits it.
A new plugin can run fine with 10 players and lag the server at 50. A VPS upgrade can deliver less than you expected. A test gives you numbers for both questions.
Only test servers that you own or have permission to test. Run the test on a copy of your server when you can, so real players are not affected.
The short version:
- Install Spark and record TPS and MSPT on an empty server.
- Optimize first: Paper, lower simulation distance, tighter entity limits, and a pregenerated world.
- Add bots in steps (10, 25, 50, 100, then more) and hold each step for 10-15 minutes.
- Run a Spark profile at each step and stop when MSPT passes 50ms.
- Fix what the profile shows, then run the same test again.
You need a bot tool for steps 3 and 4. SoulFire is free and open source. The SoulFire section below shows the settings to use.
Key Performance Metrics
Minecraft servers have two numbers you need to watch: TPS and MSPT.
TPS (Ticks Per Second) measures the server's tick rate, targeting 20 ticks per second. MSPT (Milliseconds Per Tick) measures how long each tick takes to process. Watch MSPT closely, because it shows performance trends before TPS drops. A server at 45ms MSPT is still hitting 20 TPS but has almost no headroom left.
A tick has a 50ms budget, so TPS stays at 20 until MSPT goes above 50ms. Past that point, TPS is roughly 1000 divided by MSPT.
| TPS | MSPT | Server State |
|---|---|---|
| 20.0 | <40ms | Healthy, has headroom |
| 20.0 | 40-50ms | Running near the limit, no headroom |
| 15-20 | 50-67ms | Lagging, players notice delays |
| <15 | >67ms | Severe, nearly unplayable |
The best tool for monitoring both is Spark, which works on Paper, Spigot, Fabric, Forge, and proxies. Install it, then use these commands in-game:
/spark tps # Shows TPS, MSPT, and CPU usage
/spark profiler start # Start CPU profiler
/spark profiler stop # Stop and generate shareable report
/spark heapsummary # Memory breakdown
/spark gc # Garbage collection activitySpark's profiler shows where each tick spends its time. Look for the widest sections first. A plugin that takes a large share of the tick is the first thing to check.
Optimize Before Testing
A test of an unoptimized server only tells you that it needs optimization. Apply the basics below first, then test.
Server Software
Paper is the standard for performance. It includes hundreds of optimizations over Spigot while maintaining plugin compatibility. For servers expecting 100+ players, consider Pufferfish (a Paper fork tuned for high player counts). Avoid vanilla Bukkit and CraftBukkit; they lack modern optimizations entirely.
View and Simulation Distance
These two settings usually have the largest effect.
view-distance=8
simulation-distance=4Every chunk within simulation distance requires entity processing, crop growth, and redstone ticking, which is far more expensive than just rendering terrain. Setting simulation distance lower than view distance gives players good visibility without the processing overhead.
| Server Type | View Distance | Simulation Distance |
|---|---|---|
| Budget / high player count | 5-6 | 3-4 |
| Mid-range | 7-8 | 4-5 |
| High-performance | 10+ | 6-8 |
Entity Limits
Mob AI is one of the most expensive operations on any Minecraft server. Tighten the defaults in config/paper-world-defaults.yml:
entities:
spawning:
spawn-limits:
monster: 20
creature: 5
water_creature: 2
water_ambient: 2
ambient: 1
ticks-per-spawn:
monster: 10
creature: 400
water_creature: 400
ambient: 400
collisions:
max-entity-collisions: 2 # Down from 8Pregenerate Chunks
Chunk generation is expensive, and players who explore new terrain can drop TPS far below 20. Use the Chunky plugin to pregenerate before players explore:
/chunky world world
/chunky radius 5000
/chunky startRun this overnight or on a separate server, then copy the world files to production. Never pregenerate while players are online.
Java Flags
The right JVM flags depend on your Java version and hardware. ZGC has been production-ready since Java 15, and Java 25 made Compact Object Headers (JEP 519) a standard feature. Together they are now the recommended choice for servers with sufficient hardware. For older Java versions or smaller setups, Aikar's G1GC flags remain solid.
Replace the memory values with your available RAM (Xms and Xmx should match):
G1GC vs ZGC
G1GC (Aikar's flags) divides the heap into regions and collects garbage in phases, aiming for a 200ms pause time target. It still produces stop-the-world pauses that scale with heap size, but Aikar's tuning parameters optimize it for Minecraft's allocation patterns: lots of short-lived objects from chunk loading, entity processing, and packet handling. Works well on modest hardware and smaller heaps.
ZGC does nearly all garbage collection concurrently with the application. Its pauses usually stay under 1ms, independent of heap size. G1GC pauses can reach 200ms or more, which players notice as rubber-banding. The tradeoff is higher CPU usage, since ZGC runs its collection threads concurrently instead of pausing everything.
Compact Object Headers (JEP 519) complement either collector. They shrink object headers from 12 bytes to 8 bytes, reducing heap usage and improving cache locality. The SPECjbb2015 benchmark showed 22% less heap usage and 8% less CPU time with compact headers enabled. Minecraft servers create many small, short-lived objects per tick (chunk data, entity state, packets), so they can benefit too. Measure heap use and MSPT on your own server before and after.
In practice: If your server has 8+ cores and you're running Java 25, use ZGC. If you're on older Java, constrained hardware (under 8 cores), or allocating less than 6GB RAM, stick with Aikar's G1GC flags. Monitor with /spark gc either way.
For deeper benchmarks and analysis, see brucethemoose's Minecraft Performance Flags Benchmarks and Obydux's modern startup flags.
Conducting the Stress Test
Add load in steps. If you connect 500 bots at once and the server fails, you do not learn at which point it started to fail.
Phase 1: Baseline
Start with an empty server. Record idle TPS (should be 20.0), MSPT (should be under 10ms), memory usage, and CPU. This is your reference point.
Phase 2: Gradual Load
Increase bots in steps and hold each level for 10-15 minutes:
| Step | Bots | Goal |
|---|---|---|
| 1 | 10 | Confirm test setup works |
| 2 | 25 | Watch for early degradation |
| 3 | 50 | Typical peak for small servers |
| 4 | 100 | Mid-size server stress test |
| 5 | 200+ | Find the breaking point |
At each step, record TPS, MSPT (current, median, and 95th percentile), memory trends, and any errors. Run a Spark profiler for 2 minutes during each level to capture where time is being spent.
Phase 3: Realistic Behavior
Idle bots do not load the server like real players. Add movement and actions that use the systems you want to measure:
Phase 4: Spike Testing
Events cause sudden spikes, such as 100 players who join within 30 seconds. Start with 10 bots connected, then join 50 simultaneously. Watch whether TPS drops below 15 during the surge and how long recovery takes.
Phase 5: Endurance
Some issues only show up after hours: memory leaks, gradual resource exhaustion, increasing GC pause times. Connect 50-75% of your target capacity and let it run for 4-8 hours. If memory keeps climbing or MSPT creeps up over time, something's leaking.
Identifying Bottlenecks
TPS drops proportionally with player count. This is general overhead from entities, chunks, and networking. To fix it, reduce view/simulation distance and entity caps.
Random TPS spikes have other causes. Usually it's chunk generation, large redstone devices, or a plugin running heavy tasks on the main thread. Pregenerate more of the world and profile during the spikes. The profile shows what blocks the tick.
MSPT creeping up over time points to memory pressure or resource exhaustion. Pull up Spark's heap summary and look for unusual object counts or memory usage that just keeps growing.
If TPS looks fine but CPU is pinned above 80%, you're closer to the limit than you think. There's no headroom for spikes. Optimize further or upgrade hardware.
When Spark shows a specific plugin consuming more than 10% of CPU, investigate its configuration first. Many plugins have expensive features that can be disabled. If entity AI dominates the profile (>30%), lower mob caps. If chunk operations are excessive, tighten chunk loading rates in paper-global.yml.
Using SoulFire for Testing
SoulFire runs Minecraft client code on Fabric, so its bots log in, move, and send packets through the same client code paths as a real player of that version. It supports many Minecraft versions through ViaFabricPlus, so you can test the version your server runs.
A typical run:
- Set the target server and bot count in a SoulFire project.
- Set a join delay. If the bots all come from one IP address, Paper's
connection-throttleinbukkit.ymlcan reject joins that come too fast. Raise the join delay or disable the throttle on the test server. The connection troubleshooting page lists this and other kick reasons. - Use offline accounts only if the test server runs in offline mode. An online-mode server needs Microsoft accounts.
- Turn on Anti AFK or Random jump, or use a visual script for a fixed route, so bots do not stand still.
- Keep Spark running on the server for the whole test, and hold each load level for 10-15 minutes before you add more bots.
The SoulFire testing guide covers the same run step by step, including what to record at each stage.
When to Test
Test before launches, after major plugin updates, before events with high expected turnout, and after hardware changes. A monthly baseline test also catches slow memory leaks and degradation from growing world and plugin data.
To run your first test, download SoulFire and follow the load testing steps in the docs. Before a launch, also work through the pre-launch checklist.