News for hackers. Stuff that matters.
Re:Is sequential IO dead in the era of the NVMe drive? by cperciva on Tuesday May 09, 2023 @03:43PM (#35879440)
Moving from spinning rust to solid-state storage dramatically improved the performance of random reads, but random writes still carry a penalty compared to sequential writes. So sequential I/O is perhaps half-dead; there's no need to optimize layouts for sequential reads any more.
Re:Is sequential IO dead in the era of the NVMe drive? by jasonwatkinspdx on Tuesday May 09, 2023 @04:23PM (#35879918)
Yes. And the Flash Translation Layer inside modern drives are quite sophisticated. This means you could start out with a write pattern that's causing a lot of copying and reorganization of pages in the back ground, typically because it's doing a lot of unaligned random writes smaller than the erase block size, and initially the performance will be fine. But as the drive wears in, and the capacity fills up, the FTL has less extra space to work with, forcing this garbage collection activity to become increasingly common. So you get performance degradation and premature wearing of the drive in a way that's opaque.
Re:Is sequential IO dead in the era of the NVMe drive? by bcrl on Tuesday May 09, 2023 @05:58PM (#35880915)
Short stroking SSDs is a commonly used trick in the toolbag of wise sysadmins for dealing with this kind of workload.
Re:Is sequential IO dead in the era of the NVMe drive? by oakwhiz on Tuesday May 09, 2023 @06:37PM (#35881247)
I wish that it was easier to trim unused unpartitioned space. I find myself fumbling on BSD and Linux trying to remember how to get the exact offsets for that. You could write zeroes but there isn't a guarantee that the FTL will interpret that as unused.
Re:Is sequential IO dead in the era of the NVMe drive? by mindslight on Tuesday May 09, 2023 @07:07PM (#35881527)
Just make another partition for the unused space, and run blkdiscard on it?
Re:Is sequential IO dead in the era of the NVMe drive? by renonce on Wednesday May 10, 2023 @12:51PM (#35889994)
Right, and you can use fdisk and gdisk to see the partition table and determine the offsets
Re:Is sequential IO dead in the era of the NVMe drive? by oakwhiz on Wednesday May 10, 2023 @02:33PM (#35891464)
I might put together a script for that because of the danger of making a mistake on a live system.
Re:Is sequential IO dead in the era of the NVMe drive? by Waterluvian on Tuesday May 09, 2023 @06:25PM (#35881153)
I’m guessing that means pretending they’re smaller than they really are?
Re:Is sequential IO dead in the era of the NVMe drive? by wtallis on Tuesday May 09, 2023 @06:34PM (#35881224)
Yes. The term dates back to hard drives, where using only a fraction of their capacity would minimize the worst-case distance the heads needed to travel, reducing the portion of seek latency due to head movements (but not helping with rotational latency).

On most hard drives, the beginning of the logical block address space corresponds to the outer edges of the platters where the bits are going past heads with the highest linear velocity, so sequential throughput is higher than elsewhere on the disk.

Re:Is sequential IO dead in the era of the NVMe drive? by colordrops on Tuesday May 09, 2023 @06:30PM (#35881185)
Looks like that's the case based on a cursory google search. Seems analogous to only charging batteries up to 80%. I wish companies would factor these issues into their products and leave invisible buffers, but I guess making them cheaper is more important than being consistent and reliable.
Re:Is sequential IO dead in the era of the NVMe drive? by wtallis on Tuesday May 09, 2023 @06:42PM (#35881295)
They do leave invisible buffers, commonly referred to as over provisioning. The discrepancy between GB and GiB is ~7% hiding in plain sight, and then more expensive enterprise drives are commonly sold in (usable) capacities like 960GB and 7.68TB rather than 1TB and 8TB.
Re:Is sequential IO dead in the era of the NVMe drive? by andrecarini on Tuesday May 09, 2023 @07:28PM (#35881695)
1 TB = 930 GiB

The value difference is not because of invisible buffers! Marketing material and usable OS space are measured in different units, but the usable amount of bits in each value is exactly the same.

Re:Is sequential IO dead in the era of the NVMe drive? by wtallis on Tuesday May 09, 2023 @07:37PM (#35881750)
No, there really are invisible buffers resulting from this discrepancy. The raw flash chips have nominal capacities that align with power of two sizes, but the drives use decimal-based units. So a drive advertised as 1TB will have a usable capacity of approximately 1TB, but is assembled from flash chips with a total capacity of at least 1 TiB.
Re:Is sequential IO dead in the era of the NVMe drive? by cfinnberg on Wednesday May 10, 2023 @01:12PM (#35890300)
Yes, there are invisible buffers, but the discrepancy doesn't come from this. Drive makers count the space in 1000 -multiple units (i.e. 1GB = 1000*1000*1000 bytes) whereas in computing units are usually count on 1024 -multiple (i.e. 1GiB = 1024*1024*1024 bytes)

So 1TB = 1000*1000*1000*1000 bytes/1024/1024/1024 = 931GiB (or 0.9TiB)

Re:Is sequential IO dead in the era of the NVMe drive? by wtallis on Wednesday May 10, 2023 @05:57PM (#35894053)
Did you notice the part where I explained how drive makers use the decimal units but the chips they source to build those drives are built in binary capacities?

I don't give a shit whether your operating system likes to show you disk usage in binary or decimal units, because I'm not talking about software at all. I'm explaining how the hardware is built. I especially don't need another person to try to explain what the binary and decimal units are, after I've repeatedly used both correctly.

Re:Is sequential IO dead in the era of the NVMe drive? by Osiris on Tuesday May 09, 2023 @09:50PM (#35882665)
Some flash based drives will even report this value in SMART, the amount of the over-provisioned space that has been used.

Modern QLC has very low write endurance so those drives need to have spare space to use when it starts to wear out.

Re:Is sequential IO dead in the era of the NVMe drive? by wtallis on Tuesday May 09, 2023 @11:29PM (#35883297)
I think there are two things you may be referring to. First, some drives support thin provisioning of namespaces, and can report the current amount of storage actually being used to back the namespace(s), relative to the maximum user-accessible capacity.

Second, in the SMART/drive health data, there's usually a counter tracking how many reserve/spare blocks remain usable as in not worn out and retired. That's a one-way counter; deleting data won't un-retire defective or worn-out blocks.

It's almost unheard-of for a drive to directly expose a realtime counter of how many blocks are currently unallocated, not being used to store data, and in the erased state making them available to accept new writes.

Re:Is sequential IO dead in the era of the NVMe drive? by Waterluvian on Tuesday May 09, 2023 @06:35PM (#35881235)
Sales and marketing will never leave anything on the table that might make their job easier.
Re:Is sequential IO dead in the era of the NVMe drive? by wongarsu on Wednesday May 10, 2023 @03:14AM (#35884613)
Most consumers make purchasing decisions against these buffers.

If you have two identical electric cars for the same price, one with a range of 350 miles and one with a range of 280 miles, which one would you buy?

If you have two identical phones, one with a 4300 mAh rated battery and another with a 3400 mAh battery, which one would you buy?

If you have two equally priced SSDs, one with 500GB capacity and one with 480GB, which one would you buy?

To enterprise customers the sales rep will explain "look, this device has a bit less space, but the write endurance number quoted here is much better, over 5 years and 5000 drives this will lower your TCO by X". In the consumer space you build your entire brand around one price-reliability tradeoff and stick to it, and usually the cheaper one with the bigger headline stat sells the most.

Re:Is sequential IO dead in the era of the NVMe drive? by usernew on Tuesday May 09, 2023 @11:36PM (#35883343)
Umm sorry, no. I'm a storage engineer with one of the leading enterprise vendors. SSDs are already "short-stroked." They have much more space available internally than you can see through the controller externally. The more "enterprisey" the drive, the more of that hidden space there is.

A wise sysadmin buys a drive with more of that hidden internal space, instead of getting a larger drive with less hidden space. The logic inside the drive is much better at zeroing/out and background trim on that internal hidden space, than host-addressable blocks that are currently unused. That's because the drive has no idea if you're about to use them, while the hidden space is guaranteed to be always free.

In fact - a fun fact. Flash has been used as a Write buffer on storage arrays for a couple of decades.

Re:Is sequential IO dead in the era of the NVMe drive? by wmf on Wednesday May 10, 2023 @01:23AM (#35883943)
A wise sysadmin buys a drive with more of that hidden internal space, instead of getting a larger drive with less hidden space.

The pricing of enterprise SSDs is... not exactly fair for the performance you get.

Re:Is sequential IO dead in the era of the NVMe drive? by usernew on Wednesday May 10, 2023 @02:08AM (#35884195)
that's like complaining a bentley is too expensive and not good at moving your piano.

when you get fined $1mil/min by the SEC for downtime, and data loss or corruption can cost you in the hundreds of millions, or someone dying at a hospital, enterprise gear is cheap. reliability is the key and for what you are paying. now yes, there may be a specific consumer drive more reliable than a specific enterprise drive. so which do you buy? well the enterprise array vendor tested the crap out of everything in every combination and workload and environment, and picked one for you, and it comes with full support and SLAs that you can use to meet gov regulations.

performance for an enterprise drive is not something you usually consider, at all. in fact, did you know that when I quote a storage array, I can't even specify the drive type of vendor, and who knows what will get shipped? Ionly specify drive size.

your performance comes from all your workloads clumped together, spread over a thousand of these drives connected with infiniband, with dedupe and compression on the backend, and hundreds of terabytes of RAM. the perf of an individual drive is not relevant.

but yes, sticking it into an AMD server you bought on newegg when they had a sale is not its purpose, and is a very bad deal.

now when we talk about wise sysadmins, we're talking about guys who know their stuff, and do "important big stuff." not a guy at a small business ordering from newegg. and that guy - he shouldn't be coming up with any storage policies because he lacks the needed large-scale experience.

I sold a 1PB usable-effective (after 3x dedupe/compression) space storage array last year. It was $2mil, after a 65% discount. If one time in its 5year lifecycle the "enterprisey" stuff on that array prevents about 10 seconds of downtime, it paid for itself.

Re:Is sequential IO dead in the era of the NVMe drive? by wongarsu on Wednesday May 10, 2023 @03:02AM (#35884528)
Sure, and judging by System Z sales there's still a demand for earthquake-resistant machines with hot-swappable CPUs.

But for most of us, infrequent downtime is acceptable, and most single-machine are either automatically mitigated or have very limited impact. In that scenario, getting a prosumer SSD and over-provisioning it can be a sensible choice.

Re:Is sequential IO dead in the era of the NVMe drive? by geraldhh on Wednesday May 10, 2023 @04:29AM (#35885060)
* Hetzner joined the chat
Re:Is sequential IO dead in the era of the NVMe drive? by renonce on Wednesday May 10, 2023 @12:49PM (#35889952)
There are many other ways to get reliability at the software level, usually via redundancy. Even enterprise level SSDs doesn't guarantee you free of data losses and downtimes, you have to back them up regularly and preferably set up high availability for the database.
Re:Is sequential IO dead in the era of the NVMe drive? by usernew on Wednesday May 10, 2023 @09:32PM (#35896140)
cool. so I have a few thousand VMs of various OSs and hypervisors, a few hundred home-built applications with an average of 10 components each, some mainframe, some ibm-i, a bunch of linux, solaris, aix, and HP-UX server, and I'm using mysql, sql server, postgres, oracle, and a couple of DB2. there may be an informix DB or two somewhere - I don't know, I manage storage. about ten different volume managers, about 30 different filesystems - and some raw disks of course. 10PB total space, it needs to be metro cluster replicated ten miles away for active/active, and async in a different state can be about a minute behind max.

So, write me some software that's going to make all that work and make the storage highly available. make sure it works for everything.

you're exposed to solutions that make that work, daily. when you swipe your credit card buying condoms - you have no idea how much happens so your transaction doesn't get lost, corrupted, or errored out.

Re:Is sequential IO dead in the era of the NVMe drive? by the_third_wave on Thursday May 11, 2023 @06:42PM (#35909334)
> you have no idea how much happens so your transaction doesn't get lost, corrupted, or errored out.

Maybe he doesn't, maybe he does - you don't know nor do I.

I'm pretty sure this is how IBM salesmen used to respond when confronted with those newfangled Unix systems which were starting to appear here and there, nibbling first, then taking larger bytes out of their market share. Instead of the litany of diverse systems they'd have thrown LPARs, SYSPlexs and ESMs around but in the end it still came down to the same thing: this stuff is too complicated to be left to amateurs. They were right, in a way... until those amateurs grew their wisdom teeth and took a large part of their market away from them.

Yes, "enterprise" stuff is complicated - often overly so [1] - and it has its place. This does not make it the only viable solution to these problems, something will eventually come up to eat your lunch just like IBM saw its herd of dinosaurs being overtaken by those upstart critters from the undergrowth. Maybe some smart software system which "guarantees" data reliability and availability without the need for "enterprise" storage devices? It wouldn't be the first time after all.

[1] https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris...

Re:Is sequential IO dead in the era of the NVMe drive? by bradfa on Wednesday May 10, 2023 @06:29AM (#35885641)
It depends on what kind of performance you're looking for and how you value that performance.

Under sustained long duration (ie: hours to days) of continuous full load performing small block writes, even the highest rated consumer SSD drives will begin to show significantly reduced throughput in comparison to pretty much any enterprise SSD drives.

Additionally, it's totally normal to see >=5 drive writes per day and 5 year warranties on enterprise drives. Consumer drives usually are rated significantly below 1 drive write per day and rarely for more than 3 years of warranty. If you're performing a lot of writes, you're going to need to replace worn out SSDs and that's not free in a business (remote hands, downtime, etc). So buying less durable storage has costs which don't show up on the original purchase invoice but do need to be factored in within a business setting. The warranty period is the best indication of how confident the drive vendor is about drive durability.

Re:Is sequential IO dead in the era of the NVMe drive? by Retric on Wednesday May 10, 2023 @07:40AM (#35886027)
More total space for the same price changes that equation.

Spending 2+X per GB means rather than 5x the same X it’s 5 times 1/2 or less total space. And that’s before you consider write amplification issues with having less total SSD space.

Enterprise SSD’s have a few niche benefits, but they shouldn’t be your default choice for all servers.

Re:Is sequential IO dead in the era of the NVMe drive? by osigurdson on Wednesday May 10, 2023 @08:03AM (#35886152)
I always complained to our IT group about storage - until they showed me an invoice for the drives they are buying.
Re:Is sequential IO dead in the era of the NVMe drive? by usernew on Wednesday May 10, 2023 @09:40PM (#35896193)
wait till you see your Cisco bill
Re:Is sequential IO dead in the era of the NVMe drive? by vetinari on Wednesday May 10, 2023 @08:08AM (#35886179)
> Consumer drives ... and rarely for more than 3 years of warranty.

Looking at my list of consumer SSDs and their warranties:

Samsung EVO 850: 2y

Samsung EVO 960: 3y

Samsung EVO 860: 5y

Samsung EVO 970: 5y

Samsung PRO 970: 5y

For comparison with spinning rust HDDs:

Seagate Ironwolf: 3y

WD Red (both EFAX & EFRX): 3y

Re:Is sequential IO dead in the era of the NVMe drive? by bradfa on Wednesday May 10, 2023 @10:38AM (#35888030)
But take a wider sample of consumer SSDs, a large majority are <=3 years. And look at enterprise SSDs.

Seagate Ironwolf and WD Red are not enterprise spinny hard disk drives, instead look at Seagate X18 or WD HC560.

Re:Is sequential IO dead in the era of the NVMe drive? by vetinari on Thursday May 11, 2023 @05:47AM (#35899918)
Yes, I know, I was comparing warranty on consumer SSDs and consumer HDDs.
Re:Is sequential IO dead in the era of the NVMe drive? by bcrl on Wednesday May 10, 2023 @01:38PM (#35890663)
Consumer drives usually exclude wear out in their warranties making the number of years pretty much irrelevant. What is does show is that vendors are more confidence in their FTLs and hardware nowadays compared to the first high volume SSDs on the market more than a decade ago.
Re:Is sequential IO dead in the era of the NVMe drive? by marginalia_nu on Wednesday May 10, 2023 @04:26AM (#35885044)
Most of this hides the problem. It still exists though.

I have a piece of logic in my indexing code that essentially transposes an ~100 Gb multi-value dictionary on disk. If you do this the naive way with random writes, the write amplification makes it a complete non-starter. All the caching layers and buffers fill up with completely disjointed 8 byte writes and it takes ages to write.

What I've ended up doing is to in an intermediate stage write the data to be written into a series of files, containing pairs of offsets and data (up to like 100Mb each); and then going over the files one by one and essentially evaluating them as assembly instructions.

Both passes have relatively good data locality, and despite essentially writing 2.5X as much shit to disk, it takes hours rather than weeks to do this operation.

Re:Is sequential IO dead in the era of the NVMe drive? by sumtechguy on Wednesday May 10, 2023 @08:21AM (#35886306)
Short stroke in a SSD era is more about trying to keep your data within a page of a SSD. Depending on the flash drive you are using the controller may or may not do some of it for you. One of the easiest perf gains I can sometimes get from a program that is write intensive is to put a small amount of write buffer into the mix. Depending on your OS that can help a lot too. Basically keep my code out of the kernel and off the bus and keep the write block to something that closely resembles what the drive considers a block. If you are doing a bunch of small 8 byte writes randomly in your file you probably are having a bad time as you may quickly exceed the amount of buffer the drive has for that sort of thing. It will start backing you off which bleeds up into the kernel space then very quickly into your program. Keeping them together can help, as you found out.

I see this sort of issue in a lot of programs. As it is a dead easy problem to make in your program. You need to write something out you just splat it out somewhere. With a dozens 1/4/8/16 byte writes instead of one big write. Basically not thinking about how that data is getting into your files. Most of the time that is just fine and not that big of a deal. But as your data set grows or you want better perf you have to worry about it. I usually use something like filemon and can see what is going on. You can see the pattern where there will be a large stack of I/O with hundreds of very small read and writes. While SSDs are an order of magnitude faster than the older drives. They still have their command structure and kernel context switching you have to deal with. You in some cases want to minimize that as it can become a large portion of writing and reading data. As with most optimizations (in this case the drive is faster) we just moved where the bottleneck is (to the kernel and bus typically).

Re:Is sequential IO dead in the era of the NVMe drive? by bcrl on Wednesday May 10, 2023 @01:35PM (#35890633)
Short stroking data doesn't writes within a page. It gives the FTL more time to shuffle data around in pages when garbage collecting and erasing pages. Erasing a page tends to take milliseconds of time vs microseconds of time for reads, tens to hundreds of microseconds for writes. NAND flash is typically written in smaller pages (512 bytes in older products vs 4KB-16KB ) but erased in larger pages (32KB+). It's only NOR flash that supports smaller byte granularity write sizes. NOR flash is not as dense as NAND, so it doesn't get used much beyond embedded applications.
Re:Is sequential IO dead in the era of the NVMe drive? by sumtechguy on Thursday May 11, 2023 @09:30AM (#35901737)
exactly. Also My point was more about keeping yourself out of calling into the kernel and paying the price for the context switches. Which can add up quickly.
Re:Is sequential IO dead in the era of the NVMe drive? by bcrl on Thursday May 11, 2023 @09:59AM (#35902194)
Context switches between processes are bad, but going into the kernel for an irq using things like aio and io_uring which can populate events into a result ring buffer doesn't add a ridiculous amount of overhead. Optane DIMMs avoided that, but the consequences were such that the hardware had a lot more complexity. Doing something like an FTL at DDR4 speeds and latency is very difficult. Plus you don't really want to expose hardware that requires wear leveling directly to applications, as a buggy app can wear out (damage) the hardware prematurely.
Re:Is sequential IO dead in the era of the NVMe drive? by bcrl on Wednesday May 10, 2023 @01:28PM (#35890530)
I am well aware that flash is overprovisioned. One consumer SSDs the overprovisioning is quite small (maybe 5-10%), so short stroking the SSD will have a much greater effect than on enterprise SSDs. It also has the nice side effect of giving the drive more free space to work with which allows the garbage collection room to be more gradual and efficient, which can improve performance for more write intensive workloads.

Actually, many storage arrays use battery backed RAM, not flash as a write buffer. Flash does not have the endurance needed to serve as the write buffer for a large storage array. Some products that use battery backed RAM for this purpose will dump the contents of that RAM onto flash. I worked on a messaging appliance that used that approach, albeit with supercaps to provide the hardware time to dump 4GB of DRAM onto a compact flash card. Supercaps were easier to monitor and maintain. There are also plenty of hardware RAID cards that use batteries for their write buffer as well.

Edit: there are also persistent memories like MRAM that don't need power to retain their contents which are used in this space as well.

Re:Is sequential IO dead in the era of the NVMe drive? by usernew on Wednesday May 10, 2023 @09:47PM (#35896275)
yes, big arrays (symmetrix, shark) have battery backed everything - enough to take all the cache and dump it to disk when power is lost. terabytes of RAM. they also often use use a flash cache behind the RAM - that was the primary use for Optane. The reason for this, is sustained writes instead of peaks. If you let more and more sit in cache, eventually you have write folding. That results in less write IO on the backend, and you're able to have a higher sustained peak.

smaller cheaper arrays (unity, pure, isilon) and HCI (nutanix, vxrail) that don't have terabytes of RAM - they have gigabytes, and pretty much always use flash as a write cache. In fact, I cannot name one that doesn't.

No one in enterprise storage cares about the indurance of flash. All that means is that twice a year, a vendor engineer comes out to replace a few flash drives under your support contract.

And flash has been used as a write cache behind a smaller RAM cache, for two decades, by all major storage vendors.

Re:Is sequential IO dead in the era of the NVMe drive? by sroussey on Wednesday May 10, 2023 @03:09AM (#35884572)
Why not just buy SLC?
Re:Is sequential IO dead in the era of the NVMe drive? by snovv_crash on Wednesday May 10, 2023 @03:29AM (#35884706)
SLC still has a minimum block size that gets used during writes.
Re:Is sequential IO dead in the era of the NVMe drive? by LinAGKar on Wednesday May 10, 2023 @03:20AM (#35884652)
Does that even exist anymore?
Re:Is sequential IO dead in the era of the NVMe drive? by bradfa on Wednesday May 10, 2023 @06:33AM (#35885656)
Only in very small capacity raw flash chips, generally less than 1GB in size. This is still somewhat popular in embedded systems because it's often inexpensive. But it's basically impossible to purchase an SLC flash-based drive with a modern managed interface (NVMe, SATA, eMMC, SD, etc) today.
Re:Is sequential IO dead in the era of the NVMe drive? by seunosewa on Wednesday May 10, 2023 @10:37AM (#35888021)
The discard operation mitigates this situation by marking blocks freed by the filesystem as empty so the GC doesn't have to copy them. Thus, free filesystem space will eventually be consolidated.
Re:Is sequential IO dead in the era of the NVMe drive? by GauntletWizard on Tuesday May 09, 2023 @04:05PM (#35879698)
There's still a ton of performance benefit that can be gained by keeping your read pipeline full, and you can most easily keep your read pipeline full by making it guessable by doing readahead. It doesn't need to be strictly disk-layout sequential, file-layout sequential will usually do.
Re:Is sequential IO dead in the era of the NVMe drive? by Proven on Tuesday May 09, 2023 @04:07PM (#35879709)
Far from it, sequential IO optimization isn't dead.

Sequential reads need to be optimized to produce optimal performance for selected workload. That usually means applying a lower level of inline compression.

In some cases deduplication works better before, in other after, compression. Sometimes post-process dedupe is more suitable than inline.

Then there's erasure coding and data protection methods that are still being optimized for NVMe with sequential workloads, including random workloads which are being sequentialized to work better with latest flash media.

I would even say developments in sequential IO are becoming more important than random IO.

Re:Is sequential IO dead in the era of the NVMe drive? by ilyt on Tuesday May 09, 2023 @04:43PM (#35880136)
Sequential reads will still generally be faster at least for small ones, just that NVMe are fast enough that this rarely matters
Re:Is sequential IO dead in the era of the NVMe drive? by loeg on Tuesday May 09, 2023 @05:55PM (#35880881)
> So sequential I/O is perhaps half-dead; there's no need to optimize layouts for sequential reads any more.

Yes and no. Large contiguous IOs are still faster to read than a bunch of random small sectors. You generally want your frequently read files/blobs to be split into as few operations as possible.

https://dl.acm.org/doi/abs/10.1145/3477132.3483593

Re:Is sequential IO dead in the era of the NVMe drive? by kevincox on Wednesday May 10, 2023 @04:52PM (#35893347)
This bears a strong resemblance to RAM and caches where cache lines are relatively large so you want to optimize your algorithms to touch as few "cache lines" as possible. So even in RAM random IO is slower than sequential IO.
Re:Is sequential IO dead in the era of the NVMe drive? by loeg on Wednesday May 10, 2023 @05:05PM (#35893506)
Yeah. Causing additional page accesses can also be expensive due to the TLB impact.
Re:Is sequential IO dead in the era of the NVMe drive? by almog on Tuesday May 09, 2023 @05:55PM (#35880887)
To add to that, the penalty for random writes is paid not only with performance but also in durability of the drive.
Re:Is sequential IO dead in the era of the NVMe drive? by xenadu02 on Tuesday May 09, 2023 @06:04PM (#35880967)
Flash controllers provide an abstraction layer that should turn any write workload into a sequential one, freeing software developers from having to care about it.
Re:Is sequential IO dead in the era of the NVMe drive? by wtallis on Tuesday May 09, 2023 @06:50PM (#35881376)
That abstraction layer cannot always avoid creating write amplification when you send it writes that are too small.
Re:Is sequential IO dead in the era of the NVMe drive? by dsr_ on Tuesday May 09, 2023 @07:02PM (#35881483)
Which is why having a nice chunk of RAM on the disk itself is useful. 2x write queue size x block size is nice.
Re:Is sequential IO dead in the era of the NVMe drive? by xenadu02 on Wednesday May 10, 2023 @03:06PM (#35891956)
It can but it involves additional complexity in the controller. Some definitely do a much better job than others.

Most controllers handle the block to page mapping problem well. They just mark the old block in the map as dead and write a new block on a new page. GC will later erase pages, hopefully prioritizing pages with the most dead blocks (subject to wear-leveling concerns).

But that same concept can be extended to partial block writes. It complicates the read process but there is no reason the controller can't coalesce multiple partial block writes into special partial update blocks and update the map accordingly. Basically write a record saying byte range (X,Y) was overwritten with just those bytes - no need to read the old block, merge the change, and write the whole block back out. Obviously you need to handle things like read chain thresholds (too many partially overlapping updates).

Let the GC handle merging the partial updates into the full block during idle periods. Again prioritize doing this for blocks on pages that are going to be erased - you had to rewrite those blocks anyway, turning what would be write amplification into a "free" write.

Like I said a lot of controller firmware doesn't bother but that doesn't mean it is impossible or unprofitable to do.

Re:Is sequential IO dead in the era of the NVMe drive? by wtallis on Wednesday May 10, 2023 @03:22PM (#35892200)
I didn't say it was impossible, I said it is not always possible. Even the most advanced SSD firmware will cause write amplification for some pathological workloads.
Re:Is sequential IO dead in the era of the NVMe drive? by xenadu02 on Friday May 12, 2023 @05:20PM (#35922566)
That's fair. For many systems you can come up with a pathological workload that defies any existing optimizations.
Re:Is sequential IO dead in the era of the NVMe drive? by NovaDudely on Wednesday May 10, 2023 @03:24AM (#35884677)
It was Nautilus file manager in Ubuntu that used to drag if you opened a folder with a few thousand files. It was it was essentially doing at least one request for each file when you opened a folder and this was limited by the spin rate of the HDD. So if you had 5,400 files and a 5400RPM drive, yep that would take a full minute to resolve.

Eventually the solution really just become - get an SSD because you could throw thousand of requests and the results was fast enough.

Re:Is sequential IO dead in the era of the NVMe drive? by vistu on Wednesday May 10, 2023 @04:10AM (#35884945)
While I do not doubt that Nautilus did that, I don't think it's a given that a 5400 RPM drive will take exactly a minute to scan through 5400 files.
Re:Is sequential IO dead in the era of the NVMe drive? by geraldhh on Wednesday May 10, 2023 @04:31AM (#35885075)
a sensible conclusion
Re:Is sequential IO dead in the era of the NVMe drive? by NovaDudely on Thursday May 11, 2023 @09:24PM (#35910703)
I should not have said that so literally but it was more an example of how the physical driver can limit these things.
Re:Is sequential IO dead in the era of the NVMe drive? by opan on Wednesday May 10, 2023 @11:34AM (#35888889)
You'll still find that the gtk file managers choke hard when you have hundreds of thousands of files in one directory (such as screenshots), taking minutes to load or even hanging and crashing. Both pcmanfm-qt and dolphin handle them fine and load within 30 seconds. I last tested this a year or two ago and every gtk file manager was roughly equally bad. Made me switch from pcmanfm to pcmanfm-qt (I didn't like dolphin as much).
Re:Is sequential IO dead in the era of the NVMe drive? by sliken on Thursday May 11, 2023 @02:19PM (#35906095)
Sort of. Random writes are fine as long as they are as large as the physical write block size (not the virtual 512b or 4k) and there's a queue depth high enough to keep the drive busy. Unless you are lucky enough to have Intel's (no longer made) Optanes that give nearly 100% of performance with low queue depths.

This avoids the ugly read/modify/write, as well as much of the behind the scenes magic for minimizing write amplification and shuffling blocks around.