SSD Trim Support- Current State?
What is the current state of SSD Trim/Discard support for a Qemu/KVM guests?
I run a Qemi/ KVM host wtih these kvm guests...they are all Linux os's and use raw images: 1) 20 gig Linux web-server 2) Subsonic music streaming server for my Android phone 3) Postfix server for automated emails 4) Linux guest for sandbox for testing. All of this is on my on personal system as a hobby and not a a business "production" system. If I run them off a ssd drive without the trim support, will I see performance impacted as the guest blocks slowly fill up without being marked for reuse?
Il 17/03/2013 21:58, d hee ha scritto:
Quoted 11 lines
What is the current state of SSD Trim/Discard support for a Qemu/KVM guests?
I run a Qemi/ KVM host wtih these kvm guests...they are all Linux os's and use raw images: 1) 20 gig Linux web-server 2) Subsonic music streaming server for my Android phone 3) Postfix server for automated emails 4) Linux guest for sandbox for testing. All of this is on my on personal system as a hobby and not a a business "production" system. If I run them off a ssd drive without the trim support, will I see performance impacted as the guest blocks slowly fill up without being marked for reuse?
DISCARD is finally supported in qemu.git. It is experimental in all released versions. To get trim support you need to do all of the following:
2) use virtio-scsi or another SCSI HBA (IDE would work too, but it is slow);
2) compile qemu.git from master and add ",discard=on" to the "-drive" option; or for released versions add ",discard_granularity=4096" to the "-device" options for disks. For more informations on "-drive" and "-device" check out the docs/qdev-device-use.txt file.
3) mount the filesystems with the discard option in the guest, or periodically run fstrim in the guest;
4) either run the images directly from a partition or logical volume, or mount the filesystems with the discard option in the host, or periodically run fstrim in the host.
Paolo
Quoted 3 lines · d hee
What is the current state of SSD Trim/Discard support for a Qemu/KVM guests?
I run a Qemi/ KVM host wtih these kvm guests...they are all Linux os's and use raw images: 1) 20 gig Linux web-server 2) Subsonic music streaming server for my Android phone 3) Postfix server for automated emails 4) Linux guest for sandbox for testing. All of this is on my on personal system as a hobby and not a a business "production" system. If I run them off a ssd drive without the trim support, will I see performance impacted as the guest blocks slowly fill up without being marked for reuse?
Depends of the SSD you have and the use you make of it. For recent enough SSD, TRIM support is no more required as firmwares better manage blocks and pages than in the first days of SSD.
Unless you use your SSD for big rewrites every day, I bet you won't have to enable TRIM.
Also, If you still want TRIM enabled I think there is no need for QEMU/KVM to support TRIM as you use RAW format. This is the job of your guests.
What would make high preformance degradation is not having blocks aligned.
Signature · 1 line
Nicolas Sebrecht