0

We have an ubuntu server with two SSD which host a few websites running on nginx, mysql, postfix etc...

I am so confused if we are using the 2 SSD correctly

On webmin system info page, it says :

61.50 GB used, 188.45 GB total

Unix commant

~# sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL

NAME    FSTYPE              SIZE MOUNTPOINT LABEL
sda                       223.6G
|-sda1  linux_raid_member   953M            NC-PH-0456-19:0
| `-md0 ext4                953M /boot
|-sda2  linux_raid_member    32G            NC-PH-0456-19:1
| `-md1 swap                 32G [SWAP]
`-sda3  linux_raid_member 190.7G            NC-PH-0456-19:2
  `-md2 ext4              190.7G /
sdb                       223.6G
|-sdb1  linux_raid_member   953M            NC-PH-0456-19:0
| `-md0 ext4                953M /boot
|-sdb2  linux_raid_member    32G            NC-PH-0456-19:1
| `-md1 swap                 32G [SWAP]
`-sdb3  linux_raid_member 190.7G            NC-PH-0456-19:2
  `-md2 ext4              190.7G /

And df command:

Filesystem     1K-blocks     Used Available Use% Mounted on
udev            16437532        0  16437532   0% /dev
tmpfs            3291052     9420   3281632   1% /run
/dev/md2       196664572 54339476 132312020  30% /
tmpfs           16455244        0  16455244   0% /dev/shm
tmpfs               5120        0      5120   0% /run/lock
tmpfs           16455244        0  16455244   0% /sys/fs/cgroup
tmpfs           16455244        0  16455244   0% /run/shm
/dev/md0          944108   164368    714564  19% /boot
cgmfs                100        0       100   0% /run/cgmanager/fs
tmpfs            3291052        0   3291052   0% /run/user/0

So the total should be around 400GB ?

BTW, should we running the system on ssd1 and backup everything on ssd2 ?

1 Answer 1

4

You are running the two drives in RAID 1 - which is mirroring. As a result, the total drive space is n/2, and the resiliency is n/2. This will give you the performance of roughly one drive for writes, and up to 2n for reads (with caveats - worst case is 1n for reads).

What I assume you are looking for is RAID 0 - which is striping. That would give you the total space of 2n and zero drive resiliency. This will roughly give you the performance of the drives combined.

Unless you have a good backup, redundant server, and knowledge of handling the fault domain, I would highly recommend sticking with RAID1 as you will have the opportunity to replace a failed drive. With RAID0, if a single drive is lost, the entire array's dataset is lost.

Regarding your final question - I would definitely stick with RAID1. With two drives, there's no real advantage going with a single drive that is asynchronously backed up to it's mate. Performance will be similar (except when the backup is occurring - that will induce a large amount of IO), and you have to deal with how to keep them in sync. With MDADM and RAID1, the drives don't have anything particularly fancy for storing the data - the data is all on both drives, in the exact format you write (ext4 in this case). You could pop out one of the drives, hook it up to another machine, and have fully readable ext4 partitions.

7
  • 1
    Looks like each physical drive has 3 partitions which are mirrored on the other drive. This is software RAID. Performance of RAID 1, especially software RAID 1 is less than single drive, reduced by mirroring overhead AND software overhead. The software hit is harder with SSDs than the mirroring hit. Hardware RAID 1 would improve the performance so that it would probably be almost indistinguishable from a single drive. But I agree that RAID 0 is the way to go for a web server, with the caveat that good backups are required. You end up with almost double space, and almost double throughput.
    – Jeter-work
    Sep 16, 2016 at 22:23
  • Actually, Xalorous, MDADM RAID1 can improve performance in certain situations - writes will be equivalent to the slowest drive as both drives have to write a block synchronously. However, for reads it can actually be considerably faster (up to 2n) as it can pull blocks from each drive independently. More information is here: superuser.com/questions/385519/… Sep 16, 2016 at 22:27
  • 3
    @PhamHuyAnh No, RAID is never, ever a replacement for backup. If the server gets damaged, both disks are dead. If you delete a file, it gets deleted on both disks etc. RAID1 protects you from downtime due to a broken disk and nothing more. Even using the 2nd disk as backup and not in a RAID would be a crappy, useless backup.
    – Sven
    Sep 16, 2016 at 22:31
  • 1
    Absolutely not, RAID1 just give you the ability to replace a drive without taking the server offline - it does not provide any sort of backup. Always have offsite backups. Sep 16, 2016 at 22:33
  • 1
    @PhamHuyAnh Research Grandfather, Father, Son backup rotation. It is an example of a backup plan that utilizes offsite storage.
    – Jeter-work
    Sep 16, 2016 at 22:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .