Raid:2 SSD's in a RAID1 setup with Over Provisioning

From SME Server
Jump to navigationJump to search

Setup an SME Server with 2 SSD’s in a RAID1 setup with Over Provisioning

Write Amplification

This manual describes how to setup an SME Server with 2 Solid State Drives (SSD’s) in a RAID1 setup with Over Provisioning to prevent Write Amplification.
SSD’s are much faster than conventional hard disks and they last longer if you threat them right.
An SSD is vulnerable to Write Amplification which means it writes and erases certain memory blocks more than others and therefor the most used memory blocks reach the maximum amount of writes it can do much faster.
This is because it uses the free space of the SSD to move data around which means that the Write Amplification and therefor the performance and the lifecycle of the SSD decrease drastically if the SSD just has a few % of empty space left.
2 ways to prevent Write Amplification are Over Provisioning and Trimming (Garbage collection).
Unfortunately Trimming is still unsupported on Software RAID like used in the SME Server which leaves us with Over Provisioning.
Also SSD’s in RAID5 is discouraged as it also vastly increases Write Amplification.
Because this is a manual on how to setup an SME Server with 2 SSD’s in a RAID1 setup with Over Provisioning to prevent Write Amplification, and not on What Write Amplification is exactly, I will not go into that any further.
For more information on that, this is a good place to start: http://en.wikipedia.org/wiki/Write_amplification


Over Provisioning

Over Provisioning is a fancy term for partitioning xx% less than the full capacity of the disk.
There is not a right amount of Over Provisioning but 10% is usually an average used setting which means you only use 90% of the disk size to partition.
Because the default RAID1 installation of the SME Server is not made with SSD’s in mind, it uses 100% of the 2 disks capacity which means we have to manually partition the 2 disks.
This manual shows you how to do that and it is made using the SME Server 9.0 as an example.


Setup an SME Server with 2 SSD’s in a RAID1 setup with Over Provisioning

In the Boot Menu select Advanced installation options.

Picture 1


Select Install or upgrade using the graphical installer.

Picture 2


Skip the media check unless you have a reason not to.

Picture 3


Select your language.
In this example we choose English.

Picture 4

Click next.


Select your keyboard layout.
In this example we choose U.S. English.

Picture 5

Click next.


Select Basic Storage Devices.

Picture 6

Click next.


Select Yes, discard any data.

Picture 7

Click next.


Select your timezone.

Picture 8

Click next.


Select Create Custom Layout.

Picture 9

Click next.


You are given a default RAID1 layout which uses the full disk capacity.
This is where we start costomizing the partition layout.
For the example I have two 40GByte SSD disks.
Both disks have a 250MB system partition (sda1 and sdb1) and a larger partition for the rest of the data (sda2 and sdb2).

Picture 10

Click next.


Remove all partitions by selecting sda and sdb and selection delete with both.
After that you have a 2 partition free SSD’s like shown below.
You can see the disk is 40959 MB in size.

Picture 11

Now, Over Provisioning usually is set somewhere between 5% and 25% and like said before, there is no right value to set for Over Provisioning.
Usually people set it at 10% and that is what most SSD tools advise. Setting it lower than that will age your SSD disk faster and will compromise your SSD’s performance.
If you are rather safe that sorry and the diskcapacity of your RAID1 set is not an issue you could set it to 15% or 20%.
Setting it higher seems like overkill to me.
In our example we will use 10% Over Provisioning.
The system (250MB) and swap (4064MB) partitions will be the same size as in the default setting.
That will make the size of the larger data partition: 40959MB x 0,9 = 36863MB – 250MB = 36613MB.


We will start bij partitioning disk sda.
Select sda and click create.
Select RAID Partition and click create.
Set all options like shown in the folowing screen and select OK:

Picture 12

The size of the partition (250MB) will be the same whatever size SSD you will be using.


Under sda select the Free space and click create.
Select RAID Partition and click create.
Set all options like shown in the folowing screen and select OK:

Picture 13

The size of the partition will be 90% of the SSD size - 250MB.
So this size will depend on the size SSD you are using and using 10% Over Provisioning.


Now we will do the same for the disk sdb.
Select sdb and click create.
Select RAID Partition and click create.
Set all options like shown in the folowing screen and select OK:

Picture 14

The size of the partition (250MB) will be the same whatever size SSD you will be using.


Under sda select the Free space and click create.
Select RAID Partition and click create.
Set all options like shown in the folowing screen and select OK:

Picture 15

The size of the partition will be 90% of the SSD size - 250MB.
So this size will depend on the size SSD you are using and using 10% Over Provisioning.


Select Hard Drives and select create.
Select RAID Device and click create.
Set all options like shown in the folowing screen and select OK:

Picture 16

Make sure you select both system partitions sda1 and sdb1 witch both are 250MB.


Select Hard Drives and select create.
Select RAID Device and click create.
Set all options like shown in the folowing screen and select OK:

Picture 17

Make sure you select both system partitions sda2 and sdb2.


Under RAID Devices select md1 and click create.
Select LVM Volume Group and click create.
Select Add and set all options like shown in the folowing screen and select OK:

Picture 18

Set the swap size the same as the default setting that was presented to you earlier.


Select Add again and set all options like shown in the folowing screen and select OK:

Picture 19

Set the size the same as the maximum size shown in the same window.


Select OK again in this window to start the installation.

Picture 20


The RAID1 set you just created is shown now.
Notice that both sda and sdb have 10% of free space now.

Picture 21

Click next.


Select Write changes to disk.

Picture 22


After the partitioning/formatting has finished you will see the screen below:

Picture 23

Click next.


The packages will now be installed.

Picture 24


After some time your installation will be completed and you are asked to reboot:

Picture 25

Click Reboot.
After reboot, finish your SME configuration as you are used to, set an admin password, IP-settings and so on…


Login to your server with user root and use the command cat /proc/mdstat to check if your RAID1 set is synchronising:

Picture 26


After the synchronisation finished the command cat /proc/mdstat output should look something like this:

Picture 27


Tip:
Do not use the admin account to add an SSD disk to a RAID1 set that is custum partitioned to use less than 100% of the disk space from the menu (Option 5. Manage disk redundancy) because the script behind this option will not check how the disk that needs to be cloned is partitioned.
The script will add the disk but will partition it using 100% of the disk space even when the first SSD disk in the RAID1 set is partitioned using less than 100% of the disk space.