Font Size

Category: Minecraft

Nova stranka pre mineserver.sk

Ano je to tu !

Konecne som zbastlil peknu stranu pre nas Cesko Slovensky minecraft server mineserver.sk mne osobne sa velmi paci, a pozitivne boli aj ohlasy na FaceBooku. Rozhodne lepsie ako to bolo.

Komplet zoznam aktualnych pluginov bol tiez pridany do sekcii “Server”

Vyhodil som adsense z tranky stejne to nezarabalo skoro nic, to 1Euro co to dalo za mesiac nestalo za to, takto je to asi lepsie.

Paci sa vam alebo nepaci ? Napiste do komentarov !

VladoPortos

Cesko Slovensky Minecraft server 1.8.1

Ahojte vsetci,

Nas mineserver.sk je spustil test verziu 1.8.1 enjoy !

 

VladoPortos

Minecraft in ramdisk or how to speed up minecraft server. (bukkit)

Hello all,

In this tutorial we will look at how to put our minecraft server to ramdisk.

Ramdisk is basically a disk that live in your ram, so you will need a lot of ram for this. We will be putting only maps for our servers there so depends on size of your map how much ram you will need.

I’m also going to show this for Ubuntu linux ( probably works the same for other distributions also ).

Advantages:

Speeeeed ! Read and Write speed is much much higher than at normal disks lets see test here:

vladoportos /minecraft $ dd if=/dev/zero of=/dev/shm/test.data bs=1k count=128k
131072+0 records in
131072+0 records out
134217728 bytes (134 MB) copied, 0.155647 s, 862 MB/s

Above you can see that it wrote 134MB with speed 862 MB/s (higher number is better)

and for normal disk:

vladoportos /minecraft $ dd if=/dev/zero of=/minecraft/test.data bs=1k count=128k
131072+0 records in
131072+0 records out
134217728 bytes (134 MB) copied, 0.298504 s, 450 MB/s

you can see that its almost half time slower ( this is 1+0 disk raid ) so putting your maps in ramdisk is very nice boost.

Disadvantages:

  • it is volatile memory, meaning that if server get restarted it will clean up
  • well an obvious reason, you will need a lots of memory

Very good tutorial is here: http://www.minecraftwiki.net/wiki/Tutorials/Ramdisk_enabled_server

You can basically follow that one and copy maps as they show there to /dev/shm which is basically your ramdisk.

I have created folder /dev/shm/minecraft and put maps there and my normal maps and bukkit files are in /minecraft, this is important to know when you see my scripts.

My words are called “Svet_MineCraftu” + there is nether, skylands etc… depends on your plugins.

Here is how my soft links looks like in /minecraft ( on disk ) you can see I have used ln -s as in the tutorial above ( the link ) to create soft link that points for folders with maps in ramdisk (/dev/shm/minecraft…) and have same names ending with _perm which are permanent copy stored on disks of maps.. we will keep syncing this between ramdisk maps so when we have restart of server we don’t lose all our data.

Svet_MineCraftu -> /dev/shm/minecraft/Svet_MineCraftu/
Svet_MineCraftu_nether -> /dev/shm/minecraft/Svet_MineCraftu_nether/
Svet_MineCraftu_nether_perm/
Svet_MineCraftu_nightmare -> /dev/shm/minecraft/Svet_MineCraftu_nightmare/
Svet_MineCraftu_nightmare_perm/
Svet_MineCraftu_perm/
Svet_MineCraftu_skylands -> /dev/shm/minecraft/Svet_MineCraftu_skylands/
Svet_MineCraftu_skylands_perm/

Scripts:

Syncing script that keep our ramdisk maps synced with _perm version on disks

rsync_script.sh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

MAIN_DIR="/dev/shm/minecraft"

WORLD_VOLATILE_1="/dev/shm/minecraft/Svet_MineCraftu/"
WORLD_PERM_1="/minecraft/Svet_MineCraftu_perm/"

WORLD_VOLATILE_2="/dev/shm/minecraft/Svet_MineCraftu_nether/"
WORLD_PERM_2="/minecraft/Svet_MineCraftu_nether_perm/"

WORLD_VOLATILE_3="/dev/shm/minecraft/Svet_MineCraftu_nightmare/"
WORLD_PERM_3="/minecraft/Svet_MineCraftu_nightmare_perm/"

WORLD_VOLATILE_4="/dev/shm/minecraft/Svet_MineCraftu_skylands/"
WORLD_PERM_4="/minecraft/Svet_MineCraftu_skylands_perm/"

#check if minecraft folder exist in ramdisk ( you don't wanna sync if it is not there )
if [ -d $MAIN_DIR ] && [ ! -e /minecraft/restore.lock ]; then
# Control will enter here if /dev/shm/minecraft exists
rsync -r -t -v "$WORLD_VOLATILE_1" "$WORLD_PERM_1"
rsync -r -t -v "$WORLD_VOLATILE_2" "$WORLD_PERM_2"
rsync -r -t -v "$WORLD_VOLATILE_3" "$WORLD_PERM_3"
rsync -r -t -v "$WORLD_VOLATILE_4" "$WORLD_PERM_4"
#test message when running from command line
# echo "Sync done... !"
else
echo "Minecraft DIR in ramdisk doesn't exist... ! or Lock is created"
fi

And one more script, this one will recreate the ramdisk after server reboot

ramdisk_recreate.sh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh

MAIN_DIR="/dev/shm/minecraft"

WORLD_VOLATILE_1="/dev/shm/minecraft/Svet_MineCraftu/"
WORLD_PERM_1="/minecraft/Svet_MineCraftu_perm/"

WORLD_VOLATILE_2="/dev/shm/minecraft/Svet_MineCraftu_nether/"
WORLD_PERM_2="/minecraft/Svet_MineCraftu_nether_perm/"

WORLD_VOLATILE_3="/dev/shm/minecraft/Svet_MineCraftu_nightmare/"
WORLD_PERM_3="/minecraft/Svet_MineCraftu_nightmare_perm/"

WORLD_VOLATILE_4="/dev/shm/minecraft/Svet_MineCraftu_skylands/"
WORLD_PERM_4="/minecraft/Svet_MineCraftu_skylands_perm/"

# Create LOCK file, while this file exist other script know restore is in progress
touch /minecraft/restore.lock

# here is check that will look if the directory dont exist, and if it doesnt it will create and sync it
# with permanent storage
if [ ! -d $MAIN_DIR ]; then
# Control will enter here if /dev/shm/minecraft doesn't exist
# first recreate directorys
echo "Recreating directories\n"
mkdir $MAIN_DIR
echo "Done... !\n"
echo "Restoring Maps... !\n"
# now sync
rsync -r -t -v "$WORLD_PERM_1" "$WORLD_VOLATILE_1"
rsync -r -t -v "$WORLD_PERM_2" "$WORLD_VOLATILE_2"
rsync -r -t -v "$WORLD_PERM_3" "$WORLD_VOLATILE_3"
rsync -r -t -v "$WORLD_PERM_4" "$WORLD_VOLATILE_4"
echo "Done... !\n"
echo "Removing LOCK file, syncng will continue as scheduled"
rm -f /minecraft/restore.lock
fi

And yes I know it could be done by “for” cycle but this way it is more clear for people who have no idea about bash scripts and can easy edit it… feel free to improve the scripts ( would be glad if you post me your modifications )

Don’t forget to use “/” in the end when defining your permanent and volatile map folders or rsync will create new folder inside the one you specified.

You will wont to call rsync_script.sh from cron every 5 min, you can risk 10min intervals but when you loose power and server reboot, depending when it happened, in worst case scenario you will loose 10 min from your map …

For 5 min I use this in my cron:

#Sync ramdisk with permanent map storage on HDD every 5 min
*/5 * * * * cd /minecraft && ./rsync_script.sh &>/dev/null

my script is located in /minecraft so it will cd there and execute it…

I hope this helped a little to all of you, leave a comment !

Regards,
VladoPortos

Minecraft client: out of memory error

If you are experiencing this kind of error on your client of minecraft, like client crashes with: out of memory error screen and you look stupidly on the 2GB free ram that you still have available than this is the solution for you.

Java applications start with default max allowed memory which is small… don’t ask me why, java is just stupid that way….

What you need to do is to add parameter to java so it will start with more memory. in linux you add -Xmx parameter with number of RAM you want it to use, but this is for servers mainly… for windows the solution is as follow:

Step 1.
Open CONTROL PANEL.

Step 2.
Type ‘Java’ inside the ‘Search Control Panel’ box.

Step 3.
Click the Java icon that pops up.

Step 4.
Click the Java tab.

Step 5.
Click View…

Step 6.
Assure there is only ONE line in here, any more lines could cause issues.
If you have multiple lines uninstall all versions of Java from your system and…
…download Java JDK 7 from the following link.
Make sure to get the x64 version if you have a 64-bit OS.

Step 7.
Change Runtime Parameters.
I have mine set to:
-Xincgc -Xmx2048M

***Change it depending on how much RAM you have.
For 32-bit Operating Systems 768M is recommended.
If you have 64-bit, or that doesn’t work, continue to try the following
1G
1536M
2G

This solved the issue for me, however it will not solve if the client have memory leak  which is common in java applications. It basically mean that application is creating chunks of memory that is not collected and scraped and stay in RAM unused, just using resource and in the end this adds up to memory full of garbage and app crash.

So my advice is to stay away from java ! sadly minecraft is good and fun game so no luck…

Regards,

VladoPortos 

 

Minecraft 1.7.3 + Bukkit + java 1.7 performance tuning.

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


Feel generous today ?

By me a beer !

Login