Hello,
Recently my craftbukkit server experienced java crashes “Out of Memory” errors, bukkit just crashed and java generated pid error.
I tuned the hell out of my ubuntu server thinking that this is issue with my server ( running in vmware ), later I found out that it was actually craftbukkit memory leak bug :-/
Currently I’m running development version 1024 as version 1000 gives Time Out errors after a while.
Here are some tips and tricks that helped speed up my server ( they are not all my inventions, rather collection from various forums )
This is mostly for ubuntu ( linux servers );
Install preload and irqbalance ( irqbalance you should have by default )
apt-get install irqbalance
apt-get install preload
INFO: I have 4GB ram currently dedicated to virtual machine.
Tune kernel parameters if you use mysql for logging blocks this might help a little:
What I’m using is:
sysctl -w kernel.shmall=134217728
sysctl -w kernel.shmmax=1073741824
That will change it on the run, and so it will stick after reboot use:
echo “kernel.shmmax=1073741824″ >> /etc/sysctl.conf
echo “kernel.shmall=134217728″ >> /etc/sysctl.conf
Numbers are in Bytes, giving 1GB to shared memory ( increased from 32MB )
Next is updating to java 1.7, this is must for using tuning parameters in start script.
Follow this guide to install Java 1.7 on your linux server http://www.shinephp.com/install-jdk-7-on-ubuntu/ just get the tar.gz from java site, binary files are gone for some reason :-/
My startup script looks like this now:
1 2 3 4 5 6 7 8 9 10 | #!/bin/sh #java -Xms1024M -Xmx3072M -jar craftbukkit-0.0.1-SNAPSHOT.jar nogui #java -Xincgc -Xmx2048M -Djava.net.preferIPv4Stack=true -jar craftbukkit-0.0.1-SNAPSHOT.jar NOW=$(date +"%d-%m-%Y") i=$(date +"%Hh%Mm%Ss") cd /minecraft/ cp server.log server-$NOW-$i.log > server.log java -native -server -Xincgc -Xmx2048M -Xms1024M -Xmn512M -XX:NewRatio=3 -XX:+UseThreadPriorities -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=8 -XX:+AggressiveOpts -cp "craftbukkit-0.0.1-SNAPSHOT.jar" -jar "craftbukkit-0.0.1-SNAPSHOT.jar" nogui |
To where it fits see my other post about scripts for minecraft here: http://wp.me/p1AzuH-5M
Very good post with the parameters for 32 bit and 64 bit systems is here: FORUM LINK
Any other performance tips are very welcomed, please comment.
Regards,
VladoPortos
Comments
Posted On
Jul 22, 2011Posted By
VladoPortosramdisk is another option, but didn’t experiment with it yet.. there is danger loosing all your data
Posted On
Aug 21, 2011Posted By
VladoPortosRamdisk is great ! speed up the server a lot, check my other article how to do it here on my web page.
Posted On
Sep 18, 2011Posted By
TherawroyThats all kiddie stuff
You wanna hear what i did to accelerate the game like never seen ?
Kernel Mods, Programms and Modules:
zram / rxdsk / hugepages / jdk7 / irqbalance / block device filesystem and raid0
and what do you get ? you get a drive (or folder) which can passes Speeds up to 4GB/sec (depends on system!) … yeah more then all the SSDs
and with zram you can compress the data stored inside this drive to 70% of the normal size and still get 2GB/sec Filetransfer between CPU and RAM
Harddisk:
/dev/sda:
Timing cached reads: 20082 MB in 2.00 seconds = 10054.07 MB/sec
Timing buffered disk reads: 376 MB in 3.01 seconds = 124.96 MB/sec
rxdsk device:
/dev/rxd0:
Timing cached reads: 20278 MB in 2.00 seconds = 10149.38 MB/sec
Timing buffered disk reads: 4096 MB in 1.96 seconds = 2088.39 MB/sec
Beat that
Posted On
Sep 18, 2011Posted By
VladoPortosvery nice ! zram / rxdsk I haven’t seen that yet, will definitively have a look. but for now all works fine so no need to stress
Posted On
Sep 27, 2011Posted By
VladoPortosHow do you use zram and rxdsk together ? you create rxdsk drive and how do you apply zram on it ? I only seen used for swap on net ( google ) … as rxdsk looks very interesting I’m curious about zram as well
Posted On
Oct 12, 2011Posted By
BillAnyone tried playing with the G1 garbage collector in 1.7? I was about to, but wanted to know if anyone found any improvement.
Like the ram disk options too, but mainly need to just address jvm GC issues causing periodic lag at this point.
Thanks