7

I have a Dell R610 with hardware:

  • H700 raid card
  • 4xMicron MX100 512GB -> configured raid 10

I have installed Centos 6.6 on this server and configured:

  • KVM virtualization
  • Volume Group for raid 10 array
  • Each guest VM using Logical Volumes from Volume Group

I have some questions:

  • Do I need to enable dicard (TRIM) both LVM (KVM host) and guest VM file system (vda)? If yes, then how to do this?
  • How can I monitor SSD endurance?
  • How can I optimize the the performance?

3 Answers 3

13

TRIM works at the filesystem level so as you're giving your KVM domains a raw block device then you need to enable TRIM from within the domain; your host can't know the domains filesystem utilisation without examining it. To enable this you need to ensure there's a discard='unmap' attribute added to the disk definition in the XML for the domain, this is documented at https://libvirt.org/formatdomain.html#elementsDisks .

Setting issue_discards = 1 in /etc/lvm/lvm.conf means that LVM will issue a TRIM to the underlying PV if any logical volume is reduced or deleted. It's not necessary for normal filesystem TRIM operations.

To initiate the actual TRIM operations, it's generally advised to use the fstrim utility rather than adding the discard mount option. Run this periodically from cron or equivalent. Running it manually will also show you if you've actually got everything set up properly too.

To monitor your SSD's I would assume the S.M.A.R.T. tools should suffice, have a look at the output of smartctl -a /dev/sdX.

Optimising generally involves making sure all of your partitions are aligned properly and the same as with normal disks; minimize your writes where necessary. Adding mount options such as noatime, nodiratime, etc.

3
  • 2
    I don't think this will work. 1.) I think the H700 (as most hardware RAID controllers) doesn't support TRIM. 2.) As you have the logical volume between your OS and the disks you can't access SMART info of the drive directly.
    – s1lv3r
    Dec 19, 2014 at 12:42
  • > "it's generally advised to use the fstrim utility rather than adding the discard mount option." Same thing is advised here: blog.neutrino.es/2013/… reason mentioned: "avoid doing the TRIM operation in real time (whenever a file is deleted) because you would be putting an unnecessary extra amount of work over the SSD."
    – 16851556
    Jul 23, 2017 at 16:54
  • I wanted to ask, i set "issue_discards = 1" in lvm.conf, but do i need to also do fstrim or other way set trimming on the parent ext4 LVM pool on which is either thin-lvm KVM LV or OpenVZ VPS? (having HW raid and LVM on /dev/sda5 which is not within fstab/mtab)
    – 16851556
    Jul 23, 2017 at 17:02
1

How can I monitor SSD endurance?

Install f.e. SMARTmontools, SMART is especially designed for monitoring hard drives, and these days it can monitor SSD parameter the manufactured decied aswell Search for write cycles, power on hours, power on count.

Find out what flash chips you have in your SSD, find the specs for that chip, and get the average write cycles.

From my experience the SSDs did break only on controller issues, not on write cycles, where overprovisioning should take over and replace the broken ones with spares.

How can I optimize the the performance?

Align it to the size of the "sector" size of the chips, you can find that out via specs for your SSD.

Additionally (while true for older drives it might not be needed anymore) you should not fully write the SSD as long as you have other options.

That way the garbage collection can work better.

I think that http://www.storagesearch.com/ssd.html has a lot of information you might want to read into, for a better understanding of SSDs Pros/Cons.

1

Tuning the Linux I/O Scheduler. I generally use NOOP for VM or SSD server, the default scheduler is CFQ. You can read more here:

http://dev.nuodb.com/techblog/tuning-linux-io-scheduler-ssds

You must log in to answer this question.

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