Re: SSD TRIM software raid (mdadm)

2019-01-10 Thread basti
On 10.01.19 00:51, Pascal Hambourg wrote:
> Why did you flag the SSD as write-mostly ? I would have expected the
> opposite.

Oh Sorry I understand this option in a wrong way.
Ok, I will try TRIM on LVM.

Thanks a lot.



Re: SSD TRIM software raid (mdadm)

2019-01-09 Thread David Christensen

On 1/9/19 1:22 PM, basti wrote:

Hello, I have create a software raid level 1 with mdadm.

One drive is a "classic" HDD. The 2'nd drive is a SSD with option 
"write-mostly".


Over the raid I have create and LVM with all the partitions 
(root,swap and qemu/KVM VM's).


When I understand mdadm the hole space is marked as used. So my 
question is how useful is fstrim on /dev/mdx and would it relay trim 
the SSD?


Best Regards,


On 1/9/19 3:51 PM, Pascal Hambourg wrote:
Why did you flag the SSD as write-mostly ? I would have expected the 
opposite.


+1  RTFM mdadm(8), --write-mostly would make more sense on the HDD.


But, one SSD and one HDD in an MD mirror seems strange.  If mirroring is 
not required, I would:


1.  Partition the SSD with boot, swap, root, and VM partitions.  Give 
each VM a small virtual drive image file for its system drive.


2.  Put one large partition on the HDD.  Give each VM a virtual drive 
image file, sized as required, for its data drive.



If you can install an additional SSD, mirror the two SSD's.  Similarly 
so for an additional HDD.



In any case:

1.  Try to characterize your I/O workload -- synchronous vs. 
asynchronous, read vs. write, sequential vs. random, small vs. large.


2.  Configure things to use asynchronous I/O, where possible.

3.  Install plenty of RAM.

4.  Try multiple configurations and benchmark each, preferably with 
realistic workloads.



David



Re: SSD TRIM software raid (mdadm)

2019-01-09 Thread Pascal Hambourg

Le 09/01/2019 à 22:22, basti a écrit :

I have create a software raid level 1 with mdadm.

One drive is a "classic" HDD.
The 2'nd drive is a SSD with option "write-mostly".


Why did you flag the SSD as write-mostly ? I would have expected the 
opposite.



Over the raid I have create and LVM with all the partitions (root,swap
and qemu/KVM VM's).

When I understand mdadm the hole space is marked as used.


I don't understand what you mean.


So my question is how useful is fstrim on /dev/mdx and would it relay
trim the SSD?


RAID 1 supports TRIM since kernel 3.7. Since the HDD does not support 
TRIM, it will make discarded bloc contents inconsistent between the SSD 
and the HDD but it does not matter.


However you wrote that the RAID device is used by LVM, so you cannot run 
fstrim on it directly. You must enable TRIM/discard in LVM (see 
lvm.conf) and run fstrim on LVs which contain mounted filesystems 
supporting TRIM/discard.




SSD TRIM software raid (mdadm)

2019-01-09 Thread basti
Hello,
I have create a software raid level 1 with mdadm.

One drive is a "classic" HDD.
The 2'nd drive is a SSD with option "write-mostly".

Over the raid I have create and LVM with all the partitions (root,swap
and qemu/KVM VM's).

When I understand mdadm the hole space is marked as used.
So my question is how useful is fstrim on /dev/mdx and would it relay
trim the SSD?

Best Regards,