FreeBSD Mastery: Advanced ZFS by Lucas Michael W & Jude Allan

FreeBSD Mastery: Advanced ZFS by Lucas Michael W & Jude Allan

Author:Lucas, Michael W & Jude, Allan
Language: eng
Format: epub
Tags: nonfiction
Publisher: Tilted Windmill Press
Published: 2016-04-09T16:00:00+00:00


SSDs

Solid state disks, or SSDs, are significantly different than regular spinning drives, and require tuning utterly different from traditional disks. For one thing, they’re not even disks.

For a spinning hard drive to read two sectors that reside at different locations on the disk, the read head must position itself in the right location, then wait for the spinning platter to come around to the correct location, read the sector, then reposition itself to the second sector, again wait for the platter to come around to the correct offset, then read the second sector. This waiting is called the seek time.

An SSD has no moving parts. When you read data from two different parts of the drive, the drive has a seek time of zero. Most SSDs get their relatively high read and write speeds from the fact that they read and write to multiple cells concurrently. In order to keep multiple memory cells busy, the operating system must supply the drive with a queue of work to complete.

For a normal spinning drive, having a “deep” queue is bad. It means the amount of time between when data is requested and when it is written or returned is higher, because it must wait for the work ahead of it in the queue to complete. By having a lower queue depth, more important work items can get to the front of the queue first, cutting in front of less important work that has been patiently waiting in line5. To get the most out of an SSD, however, the queue depth must be high enough to make sure each cell gets assigned work. You cannot get the performance numbers boasted on the box without a nice full queue.

To get the most out of a high IOPS device like an SSD, the ZFS VDEV queue depth tunable probably needs increasing. This helps keep enough work in the queue to prevent the device from being idle. See the “I/O Queues” section of Chapter 8.

Unlike a spinning disk, which has sectors that reside at fixed locations on the platter, SSDs are an array of immobile flash cells. SSDs use an FTL6 (Flash Translation Layer) to map the emulated locations on disk to the particular flash cell containing stored data. While SSDs claim to have the Logical Block Addresses used by spinning disks, the FTL provides these LBAs. LBAs on an SSD bear even less relationship to reality than they do on spinning disks.

Since flash cells wear out, almost all SSDs contain more storage than they claim on the box. The drives spread data around the cells in order to wear them more evenly. Once all of the space is occupied, a garbage collector runs. The garbage collector finds cells that are no longer referenced, or which the OS has used the TRIM (SATA) or UNMAP (SCSI) command to mark as unused, and clears them for further use.

When you add SSDs or other devices that support TRIM to a ZFS pool, FreeBSD TRIMs the entire partition or device by default, so that it starts in a known state.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.