Jump to content

Linux CentOS Optimization Guide.


jominer247

Recommended Posts

Hello.

 

I have myself, for some time been experiencing lag, even on Linux CentOS. In my opinion CentOS is the best OS for minecraft servers as it offers a premium OS (redhat) for free, although some upstream artwork may not exist in CentOS.

 

Anyways, down to business.

 

Pre installation Configuration.

The best way, or the way I do it for most speed, is to make sure your server is on SSDs and make sure you're using the EXT4 filesystem and not the EXT3 filesystem. Also be aware that Linux nor SSDs fragment. So there will be no need for defragmentation.

If you are on OVH, Make sure to install the distrobution kernel. You can actually do this after the server is installed through grub, although I recommend installing the kernel from the start.

Make sure you also have a seperate filesystem called /servers that uses the remaining space, don't put you're server in /home or /root or / otherwise these partitions may be messed with by the OS (Just a theory that came to mind.)

Also, I know this is a little more risky, but don't use RAID. RAID will end up slowing you're drive down to the speed of the slowest drive.

 

Disconsented said:

Maybe true for RAID1 but not for RAID0,5.1+0

I prefer not to use RAID at all. But disconsented has a very valid point, so i thought i'd better add it.

Packages to Install

I find the following packages help improve performance:

preload

IRQBalance.

These as far as i'm aware are available on all linux distributions, and massively help improve performance

 

Preload loads commonly accessed files into RAM, meaning it's faster to access

IRQBalance balances load across multiple cores. I'm not sure if this works with minecraft but it certainly speeds up the OS a considerable amount.

 

To install preload:

wget ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/halocaridina:/fun_stuff/CentOS_CentOS-6/x86_64/preload-0.6.4-3.1.x86_64.rpm

Then

rpm -Uvh preload-0.6.4-3.1.x86_64.rpm

To install IRQBalance:

yum install irqbalance

Installing java.

Yes, the java version matters. Technic recommend java 1.7.0_67. So thats the one that I use, but I use a server package of java that improves performance.

Here's how to install the server package:

cd /opt/
wget wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/7/jre-7-linux-x64.tar.gz"
tar xvzf jre-7-linux-x64.tar.gz
cd <java directory after extracted, should be in /opt/>
alternatives --install /usr/bin/java java /opt/<directory of java> /bin/java 2
alternatives --config java

/etc/fstab configuration

Add the following arguments to your /servers /home and / partitions in /etc/fstab:

nodiratime,noatime,barrier=0,trim

 

TRIM IS FOR SSDS.

 

Multicraft

I'll make a tutorial for multicraft soon.

 

MySQL

yum install mysql
yum install mysql-server
mysql_secure_installation
mysql -u root -p
CREATE DATABASE <name of your database>;

Thanks for reading

Joseph

Edited by jominer247
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...