Monday, February 15, 2010

Hard drives-Partitioning for performance-Web server

SkyHi @ Monday, February 15, 2010
A lot of people do not know that RAID-1 (mirroring) is better for a web server. Also RAID-1 is better for serving an OS and a file server.

I suggest putting four 72 GB hard drives in RAID-1 to minimize the time to find four files
. Set this for the web server files. Then for your two 36 GB hard drives, put them in RAID-1 as well. Use the 36 GB hard drive for the OS.

[36 GB RAID-1 array]
16MB-128MB /boot
1GB swap
2GB /var/log
1 GB or more /var/mysql
4 GB /
all unused space /home

[72 GB RAID-1 array]
all /var/www

I know I suggest a different RAID setup than yours but RAID-5 is better for in a NAS backup or on a 1 gigabit network. I suggest using either EXT3 with b-tree or XFS.


Web Server Partitioning

A lot of good info on this board. I decided to register to see if you guys can help me out. I'm installing CentOS 4.3. I'm at the step where it asks for partitioning. It has been suggested to me by an experienced webhost to use the following partitions and sizes:

/ 2000M
/boot 600M
/usr 6000M
/var 6000M
swap match the amount of memory

"By doing this and seperating the partitions, when the / partition fails or the kernel on it fails, you can either just reinstall on the / partition without affecting the important data OR you can take the drive and mount it in another system."

I was under the impression that the kernel was always on /boot? Or is it on always on / ?

Either way, 6GB doesn't seem like enough space for the logs and databases.

If the kernel is on /boot then I thought that this might be another way to partition without the risk of losing the data if the kernel or the boot /partition fails:

/boot 600M
swap match the amount of memory

What do you guys recommend and why?

Also, one of the next steps asks this:

Where do you want to install the boot loader?

/dev/hda Master Boot Record
/dev/hda1 First Sector of boot partition.

What is best and why?

thanks for your help. This is my usual scheme .. I don't say it is better.. Everybody has the best sollution .. but it works for me ...

/ - 2 GB
/boot - 100 MB - it is much more than is necessary but for recovery uses is good
swap - if RAM < 1 G = swap 2x RAM
- if RAM > 1 G = swap 1x RAM
/tmp - 2 GB mount it as nodev due to security reasons
/var - rest of disk .. (if you want have users webs in home so use this on home instead of var)

kernel is on boot usually ..

If linux is on your box only so use MBR ..