Fix High CPU Usage on Minecraft Servers
Diagnose and fix high CPU usage on Minecraft servers, Spark profiling, tick analysis, entity optimisation, garbage collection tuning and hardware considerations.
Is High CPU Usage Actually a Problem?
A Minecraft server using 80-100% of one CPU core is not inherently bad, the game loop is single-threaded, so one core running hot is expected under load. The problem is when CPU usage causes TPS drops below 20, or when the server consumes more CPU than your host allows. Understanding your minecraft server high cpu usage is the first step to deciding if it needs fixing.
Check your TPS first: /spark tps. If TPS is 20 and CPU is high, your server is working hard but keeping up. If TPS is below 18 and CPU is maxed, you have a bottleneck to fix.
Step 1: Profile with Spark
Spark is essential for diagnosing minecraft server high cpu usage. Install it and run a profiler:
/spark profiler start --thread server
# Let it run for 5-10 minutes during peak
/spark profiler stop
The flame graph shows exactly which methods consume the most CPU. Focus on the "Server Thread", this is where tick processing happens. Common CPU-heavy operations:
- Entity AI and pathfinding: Villagers, pillagers and other mobs with complex AI.
- Chunk generation: Creating new terrain is very CPU-intensive.
- Plugin event handlers: Poorly optimised plugins running expensive code every tick.
- Redstone and hoppers: Large redstone contraptions or hopper chains.
- Garbage collection: If GC shows up prominently, it is a memory issue causing CPU pressure.
Step 2: Reduce Entity Load
Entities are the number one CPU consumer on most servers. In paper-world-defaults.yml:
- Reduce
spawn-limitsfor all mob types. - Increase
tick-ratesfor villager behaviours (they are disproportionately expensive). - Enable
per-player-mob-spawns: true. - Use
entity-activation-rangeto skip AI for distant mobs.
Step 3: Pre-generate Your World
Chunk generation on the fly is one of the most CPU-intensive operations. Use Chunky to pre-generate terrain before players explore it:
/chunky radius 5000
/chunky start
Run this during off-hours. Once the playable area is pre-generated, new chunk generation drops to near zero during normal gameplay.
Step 4: Tune Garbage Collection
If Spark shows GC-related methods consuming CPU, your memory configuration is the issue. See our OOM guide for JVM flag tuning. Key points:
- Set
-Xmsequal to-Xmx. - Use G1GC with Aikar's flags.
- Do not over-allocate: giving the JVM 32 GB when it only needs 10 GB causes longer GC pauses.
Step 5: Optimise Hoppers and Redstone
In paper-world-defaults.yml:
hopper:
disable-move-event: true
cooldown-when-full: true
redstone-implementation: alternate-current
These two changes alone can reduce CPU usage by 10-20% on servers with large redstone and hopper setups.
Step 6: Audit Plugins
Review the Spark profiler output for plugin class names in the hot path. Disable suspected plugins one at a time and re-profile. Common offenders:
- Anti-cheat plugins with per-tick checks
- Hologram plugins rendering hundreds of entities
- Scoreboard plugins updating every tick
- Custom enchant plugins with damage event listeners
Hardware Considerations
Minecraft's main game loop is single-threaded, so clock speed matters more than core count. A 4-core CPU at 5 GHz will outperform a 16-core CPU at 3 GHz for Minecraft. If you have optimised everything software-side and still hit CPU limits, consider migrating to a host with higher single-threaded performance.
For the broader picture on lag, see our comprehensive lag fix guide.
Want to just play without the headaches? Join Astroworld MC, IP play.astroworldmc.com, Java + Bedrock.