Why does ashift=12 give better perfomance even if both physical and logical sector size of an SSD is 512bytes?


context: I am creating a new zpool and I read on some forums and wikies

In: 0

SSDs don’t have 512 byte sectors in reality. Almost nothing does these days, they’re likely at least 4K in size. Everything will pretend to have 512 byte sectors for backwards compatibility, but that doesn’t mean that’s how it works on the inside.

SSDs have a complex [internal structure](https://theithollow.com/wp-content/uploads/2013/10/Pages.png). Pages are what you can write. Blocks are what you can erase. Overwriting isn’t possible without erasing a whole block.

And all of that stuff is an internal design thing that may vary from one model to another. So if you’re really concerned the best thing is to benchmark against your specific hardware.

Some SSDs allow to configure the sector size, but changing it involves wiping the entire device. Note that doesn’t really change what’s happening in the guts. A device that really has 4K pages on the inside will just pretend to have 512 byte sectors at a performance impact if configured for it (likely the default out of the factory)