Posts

Maxing Random Read IOPS on a Datacenter SSD with a Single Desktop E-Core

Image
Sitting under my desk is a three year old system based on an Intel i9-13900KS CPU. This is a consumer CPU with 8 "performance cores" and 16 "efficient cores" (p-cores and e-cores). It's been a fine personal test system, but with the mix of core types, I've always pinned my benchmarking workloads to the p-cores, leaving the e-cores to whatever else the scheduler had in store for them. I knew that an e-core could not drive as many IOPS as a p-core, but I always wondered about their performance limits for IO work. There is no way around their lower frequency, but it’s not clear whether their other architectural tradeoffs strongly affect the task of moving data to and from an SSD. This blog documents my exploration process as I tried to saturate the random read performance of a Gen5 datacenter-class NVMe drive using a single e-core. For this testing, I used a ScaleFlux CSD5310. This model advertises 2.8M 4kB random read IOPS. I would have liked to use a CSD5320,...

The LZ4 Trade-Off (Illustrated and Simplified)

LZ4, gzip, and increasingly Zstandard are the dominant choices for general-purpose, lossless compression. It's often stated that LZ4 is the most "CPU friendly" and thus fastest algorithm, but the trade-off is a lower compression ratio. On the other hand, gzip compresses better but is much slower. But what does "CPU friendly" mean and how does LZ4 compare to gzip and Zstandard? Compression is an immensely complicated topic [1], but we can distill compression algorithms down to two primary techniques:  Eliminating repeated data Encoding data in a more compact format In general, the first technique aligns well to modern CPUs while the second is more challenging. A "CPU-friendly" algorithm like LZ4 skips the second compression technique in order to avoid multiple passes over the data or working with non-byte aligned values. Instead, it only performs the first technique, working over a single pass through the data on byte-sized values that CPUs can process ...

Three Things I Wish Every Storage Software Vendor Provided

In my work on SSDs, I have the opportunity to test a wide variety of storage software from parallel filesystems to high performance databases. SSD device vendors are always interested in demonstrating compatibility and (ideally) great performance at the application level. In my time working on "the other side of the wire," there are three things I wish every storage software vendor provided to benefit the relationship between SSDs, the application, and ultimately end users: 1. Create a storage-specific microbenchmark. This benchmark should use as much of the application's IO stack as possible and focus on the aspect(s) of performance most relevant to the application. It should measure a very limited number of metrics (or even a single key metric). The hardware requirements for the benchmark should be kept modest, using the minimum quantity of SSDs and servers. If your benchmark requires 6+ servers and multiple clients, few will want to run it more than once (if at all), ...

The Weight of Data

Many have claimed that SSDs become ever so slightly heavier as they're written due to the fact that programming a cell adds electrons to a floating gate or charge trap, and electrons do have mass, however small. Let's do some arithmetic to see what all that data weighs on a modern SSD. If we're being pedantic, this is actually the mass stored by Flash and not the weight of the entire SSD (the drive does not become net negatively charged). We'll assume a TLC-based "datacenter" class SSD. We know an electron weighs ~9.1 x 10^-28 grams. We just need to estimate how many electrons are contained in a full SSD. Let's do this per TB of user capacity. Due to overprovisioning, a TB will consume a larger amount of physical capacity internally. In addition, there is some spare area in each NAND page that is used for storing ECC information (such that the host data in the page can remain a power-of-two quantity). In a typical datacenter TLC drive, 1TB of user capacity...

Mixups with rwmixread

I saw an interesting question about FIO on Twitter. I will paraphrase here: I observed that tests ran against a Ceph block device with FIO using the randrw parameter produce the exact same IOPS on read and write channels, but in other IO tests with the same drive, I saw the same amount of write IOPS but much higher read IOPS. Why? The glib answer is "because that's what you told FIO to do." When using rw=randrw, the default mix of reads and writes is 50/50. FIO will dutifully enforce this ratio in terms of IOPS. Outside of FIO, there is nothing forcing a 50/50 mix of read and write IOPS and the SSD is free to service more reads if it has the bandwidth to do so. The core issue is that read and write performance of SSDs is not symmetrical, but using the rwmixread parameter binds their performance together through IOPS. This has the tendency of producing lower read IOPS than what the SSD is otherwise capable of servicing. Consider a workload that is 70% read and 30% write, b...

NVMe & sysfs

The Linux NVMe driver exports a really useful set of information to sysfs . While there's absolutely no comparison to nvme-cli's capabilities, there are a few nice things about using the information reported by sysfs to do basic inspection of the NVMe drives connected to a system. First, the information is available in user space, so super user privileges are not required. Second, there are no dependencies to download. Lastly, you can get some information that's not available in nvme-cli, or would require a set of nvme-cli commands to execute and parse. I'm often adding drives to different systems and interested in the drives' NUMA affinity and whether they negotiated to the proper PCIe generation and link width. It's very easy to retrieve this information via sysfs and print it along with other useful information about the drives such as model numbers, firmware revisions, and namespace configurations. I have a small Bash function that I use in my own custom .r...

Why SSDs "Lie" About Flush

A Flush command requests that an SSD controller writes any data held in its volatile write cache to the NAND media. The intent is to ensure that all completed writes by the controller are actually persisted to the media. I sometimes hear people complain that SSDs "lie" about the Flush command, implying some nefarious, lazy, or outright bad firmware design. The truth is that Flush is quite a pernicious operation for NAND-based SSDs, and SSD designers are forced to balance between honoring Flush as it is intended and protecting the SSD from premature wear-out in the face of excessive Flush operations. The root of the problem is the mismatch between host write units and the minimum write unit of the SSD, which is a NAND page (it could be larger depending on the controller design). Hosts typically write to SSDs in units of 4kB while a NAND page today is commonly 16kB. An SSD controller would like to accumulate enough data from the host to write out at least a single page of data ...