Live data from Hacker News

Everything I Know About SSDs

kcall.co.uk

81–90 of 190 posts

Re: Everything I Know About SSDs

#81
post #73
post #59

I hoped it would discuss how SSDs cope with sudden power loss, but it doesn't seem to. I remember this page but I don't know of a modern update: http://lkcl.net/reports/ssd_analysis.html These days, if I want an SSD for my desktop and want to minimise the chance I have a disk problem and have to restore from backup, would I be better off with one "data centre" drive (eg Intel D3-S4510), or two mirrored "consumer" dri…

The big problem with one data center drive is that if that goes bad, you still lose all your data. You're assuming their marketing MTBF is correct. They do make NVME raid solutions now -- with the advantage being that NVME can be faster than SATA. And there are various price points for the NVME drives depending upon speed. This one from 2018 (not sure if it has full raid or uses VROC)(EDIT: it requires software raid)…

Almost all NVMe RAID products—including both that you've linked to—are software RAID schemes. So if you're on Linux and already have access to competent software RAID, you should only concern yourself with what's necessary to get the drives connected to your system. In the case of two drives, most recent desktop motherboards already have the slots you need, and multi-drive riser cards are unnecessary.

Re: Everything I Know About SSDs

#83

Earlier quoted context omitted.

> I find myself copying entire/ partitions between SSDs from time to time, is there a utility to clear the destination SSD before copy? The way TRIM works, you don't need to trim blocks right before overwriting them. TRIM is for blocks that you aren't going to care about for quite some time, it essentially returns them to the SSD management layer for use as overprovisioning.

> The way TRIM works, you don't need to trim blocks right before overwriting them. In my experience "blkdiscard /dev/DESTINATION_DISK" does improve the speed of dd'ing a disk to another one quite a bit though. And that does make some sense IMHO: If the SSD's internal datastructure which keeps track of pages which hold user-data is empty then each write will consume less time for looking up if the specific sector is c…

> then each write will consume less time for looking up if the specific sector is contained in the datastructure.

For most SSDs, this lookup is a single DRAM fetch per 4kB of user data, and therefore much faster than even a single NAND flash read, let alone a NAND flash program or erase operation.

The reason that imaging a SSD is faster after it's been trimmed or secure erased is that every erase block is empty and ready to accept new data. When you overwrite data on a used disk, the drive has to free up erase blocks and that generally involves moving old data elsewhere to preserve it—because the drive doesn't know that the commands to overwrite that are also coming soon.

Re: Everything I Know About SSDs

#84
post #82

The author forgot about non-NAND SSDs (e.g. Optane SSDs). There's no garbage collection to worry about, for example.

Optane SSDs do need wear leveling. What makes it much simpler is that there isn't the mismatch between small-ish NAND pages and massive NAND erase blocks, so you don't have to suffer from the really horribly large read-modify-write cycles.

Re: Everything I Know About SSDs

#85

Earlier quoted context omitted.

> to an HDD all sectors are the same. Also I believe some humans, and (filesystems?) intentionally stored certain data towards the inside/outside of the HDD because the simple cylinder geometry allowed faster reads in those regions. However, I'm not seeing conclusive proof that modern HDDs show performance variation with respect to radius.

Io schedulers would also understand the geometry and reorder commands to minimize seek distance (and therefore seek time).

At some point, I think around the mid '90s or early 2000s but maybe earlier, though, seek time was fast enough on widely available drives that on average for random access you spent about as much time on the right cylinder waiting for the sector you wanted to rotate to under the head as you did on seeking to the right cylinder.

You could get some decent gains then if you made your scheduler take rotation into account. A long seek that arrived just before the target sector came under the head could be faster than a short seek that would arrive just after the sector passed the head.

On the other hand, taking rotation into account could make the scheduler quite a bit more complex. You needed a model that could predict seek time well, and you needed to know the angular position of each sector in its cylinder.

I don't think that there were any drives that would tell you this. SCSI drives wouldn't even tell you the geometry. IDE drives would tell you a geometry, but it didn't necessarily have anything to do with the actual geometry of the drive.

At the time I worked at a company that was working on disk performance enhancement software (e.g., drivers with better scheduling, utilities that would log disk accesses and then rearrange data on the disk so that the I/O patterns in the logs would be faster [1], and that sort of thing).

We had a program that could get the real disk geometry. It did so by doing a lot of random I/O and looking at the timing of when the results came back. If there were no disk cache, this would be fairly easy. (Well, it didn't necessarily get the real geometry, but rather a purported geometry and seek and rotational characteristics that could predict I/O time well).

For instance, read some random sector T, then read another random sector, then read T again. Look at the time difference between when you started getting data back on the two reads of T. This should be a multiple of the rotation time.

If the disk has caching that can still work but you need to read a lot of random sectors between the two reads of T to try to get the first read out of the cache.

Anyway, we had to give up on that approach because the program to analyze the disk took a few days of constant I/O to finish. Management decided that most consumers would not put up with such a long setup procedure.

[1] Yes, that could mean that it would purposefully make files more fragmented. A fairly common pattern was for a program to open a bunch of data files and read a header from each. E.g., some big GUI programs would do that for a large number of font files. Arranging that program and those data files on disk so that you have the program code that gets loaded before the header reads, then the headers of all the files, and then the rest of the file data, could give you a nice speed boost.

The flaw in this method is that, to use the above example, if another big GUI program also uses those same font files, the layout that makes the first program go fast might suck for the second program. If you've got a computer that you mostly only use for one task, though, it can be a viable approach.

Re: Everything I Know About SSDs

#86
post #78
post #75

Earlier quoted context omitted.

I'm really interested in how you benchmarked that? Is there a "simple" way to specify the physical location on a HD data should be written to?

Hard drives generally use a fairly simple linear mapping between LBAs and physical location. Low LBAs are on the outer edge of the platter where transfer speeds are highest, and high LBAs are on the inner edge where speeds are lowest. Unlike SSDs, hard drives don't need wear leveling, so there's no reason to break from that pattern except in the relatively rare instance of damaged sectors. At smaller scales, the layo…

Your link was discussed @ https://news.ycombinator.com/item?id=21492345

Re: Everything I Know About SSDs

#87

Earlier quoted context omitted.

Reader view helps a lot, and with such a simple website it is guaranteed to give a good result.

not if you're reading via Materialistic via Android browser with no responsive design or zoom ~,~

In Materialistic you can hit the red round button that appears bottom right of the screen. That way you can zoom. It won't help you much with this article, but it can be handy sometimes.

Re: Everything I Know About SSDs

#88
post #85

Earlier quoted context omitted.

Io schedulers would also understand the geometry and reorder commands to minimize seek distance (and therefore seek time).

At some point, I think around the mid '90s or early 2000s but maybe earlier, though, seek time was fast enough on widely available drives that on average for random access you spent about as much time on the right cylinder waiting for the sector you wanted to rotate to under the head as you did on seeking to the right cylinder. You could get some decent gains then if you made your scheduler take rotation into account…

> I don't think that there were any drives that would tell you this. SCSI drives wouldn't even tell you the geometry. IDE drives would tell you a geometry, but it didn't necessarily have anything to do with the actual geometry of the drive.

I thought the point of native command queuing was precisely to enable the drive itself to make these lower-level scheduling decisions, while the OS scheduler would mostly deal with higher-level, coarser heuristics such as "nearby LBA's should be queued together."

BTW, discovering hard drive physical geometry via benchmarking was extensively discussed in an article that's linked in the sibling subthread. I've linked the HN discussion of that as well.

Re: Everything I Know About SSDs

#89
post #78

Earlier quoted context omitted.

Hard drives generally use a fairly simple linear mapping between LBAs and physical location. Low LBAs are on the outer edge of the platter where transfer speeds are highest, and high LBAs are on the inner edge where speeds are lowest. Unlike SSDs, hard drives don't need wear leveling, so there's no reason to break from that pattern except in the relatively rare instance of damaged sectors. At smaller scales, the layo…

Your link was discussed @ https://news.ycombinator.com/item?id=21492345

Yep. I found it interesting enough to bookmark, and now I tend to pull it up when somebody wants to know how hard drives really work.

Re: Everything I Know About SSDs

#90
Excellent summary. One thing he left off: some SSDs continue to copy/erase blocks even if there is nothing new to write because multi-level cell state does degrade over time. There is a concern that some MLC drives will suffer bit corruption over time if not regularly power up to allow this in the background. Citation needed: I only recall this when I was interviewing to work for Western Digital many years ago.
Post reply on HN