Minecraft server using way too much CPU
I have an i5 at 3.1 GHz with 8 GB RAM running two Minecraft server instances using the Sun JRE.
Since a few days, the servers start showing the familiar "Can't keep up" message; CPU usage per process is at 187%.
I've already run the Minecraft Region Fixer, which found no problems.
As I think the hardware should be sufficient, I wonder what else may be wrong here.
Solution 1:
Common server problems I notice are these:
Complex structures: I have a city world generator on one of my maps and it tends to be hard on my server: http://smp.smokinminecraft.com:8123/
Too many mobs: use entitypolice or similar bukkit plugins to monitor/remove them: http://dev.bukkit.org/server-mods/entitypolice/
REDSTONE: How to find a player's redstone clock (or other aggressive circuitry)?
The infamous lighting bug: this causes the terrible black shadows and something about the lighting causes lag, and it's a problem if you have a lot of nether areas. Nolagg has a fix: http://dev.bukkit.org/server-mods/nolagg/
You shouldn't run two servers on one machine unless you've divided their use to different cores, and even then the hard drive IO bottlenecks pretty bad. It's better to use multiverse and have separate worlds: http://dev.bukkit.org/server-mods/multiverse-core/
You can also modify your bat file or command to use more RAM per world so you're able to cache more, and if you want >2gb then you'll need 64bit java
Solution 2:
Oh wow, found it.
It's the leap second bug, which causes Linux futex
es to time out immediately, making java
threads spin consuming 100% CPU.