FTB Ultimate Server constantly giving "can't keep up!" errors

I am looking for some tips for getting a FTB Ultimate server server up to speed. I constantly get the "Can't Keep Up" messages.

I am running a FTB ultimate 1.1.2 server on Windows 2008 R2, with an AMD FX 4170 Quad-Core @ 4.20 GHZ and 8 GB of RAM. The server itself is running on a dedicated WD Black SATA 3 drive. This drive is currently only in use by the FTB server.

There are only two of us on the server at the moment, and I am on the same local network. Both of us experience jerkiness and general lag. Lately my friend has been experiencing upwards of one minute just to open the crafting table.

There have been no changes to the FTB server aside from general changes to the GregTech and Advanced solar panel configs. The lag was happening before that as well.

I have noticed that at times the Minecraft server has worlds listed as having 5000+ chunks cached, or close to 2 GB of RAM allocated. The server generally is at 60-70% CPU usage.

My startup config is pretty basic, but is allowing a max of 5GB:

"C:\Program Files\Java\jre7\bin\java" -Xms512M -Xmx5G -jar ftbserver.jar

I am currently running Java 64-bit, version 7 Update 25


Solution 1:

Found a thread on the FTB forum, and while some of the info may be contradictory or misinformation, i did see they were using a special startup config. While I am not entirely postive of what this does....what I can (hopefully) deduce from it is that it is enabling the FTB server to use SS4 cpu instructions and modifying how garbage collection is ran. After running the server with this config, within minutes the "tick lag" on the server disappeared, everything moved very smoothly.... and best of all, CPU usage went from 70% to 14% even with several chunk loaders and a quarry.

Thread found: http://forum.feed-the-beast.com/threads/how-to-make-an-efficient-server.5525/

Startup config used:

"C:\Program Files\Java\jre7\bin\java" -server -Xincgc -Xmx3072M -Xms1024M -Xmn512M -XX:NewRatio=2 -XX:CMSFullGCsBeforeCompaction=1 -XX:SoftRefLRUPolicyMSPerMB=2048 -XX:+CMSParallelRemarkEnabled -XX:+UseParNewGC -XX:+UseAdaptiveSizePolicy -XX:+DisableExplicitGC -Xnoclassgc -oss4M -ss4M -XX:+UseFastAccessorMethods -XX:CMSInitiatingOccupancyFraction=90 -XX:+UseConcMarkSweepGC -XX:UseSSE=4 -XX:+UseCMSCompactAtFullCollection -XX:ParallelGCThreads=4 -XX:+AggressiveOpts -cp "ftbserver.jar" -jar "ftbserver.jar"