helloSystem / helloSystem/ISO

For NVMe SSDs, use native 4K (4096-byte) sectors if possible

Open
#531 2 comments 0 reactions 0 assignees View on GitHub
freebsd help wanted
Dominant language
Shell
Stars
847
Forks
66
PR merge metrics
No merged PRs in 30d

Description

For NVMe disks, we should use native 4K (4096-byte) sectors ("Advanced 4Kn Format") if possible; this gives a ~10% performance enhancement.

It seems that by default NVMe SSDs in FreeBSD are running in 512-byte sectors, which is not ideal:

```
Users-Laptop% sudo diskinfo -v /dev/nvme0ns1

/dev/nvme0ns1
512 # sectorsize
256060514304 # mediasize in bytes (238G)
500118192 # mediasize in sectors
0 # stripesize
0 # stripeoffset
No # TRIM/UNMAP support
Unknown # Rotation rate in RPM
```

This is for a [Transcend PCIe SSD 220S](https://www.transcend-info.com/Products/No-991), which "aims at high-end applications, such as digital audio/video production, gaming, and enterprise use".

How can we know whether a SSD supports native 4K sectors?
The [data sheet](https://cdn.transcend-info.com/products/images/modelpic/991/Transcend-PCIeSSD220S.pdf) doesn't specify sector size.

`smartctl` output ("SMART" in Hardware Probe) shows:

```
Supported LBA Sizes (NSID 0x1)
Id Fmt Data Metadt Rel_Perf
0 + 512 0 0
```

Does this mean that this SSD will not support 4Kn?

In case it _did_ supoprt 4Kn, would we have to

```
sudo pkg install nvme-cli
nvmecontrol format --lbaf=1 /dev/XXX
zpool create -o ashift=12 ...
```

?

And how to tell __bsdinstall__ to do "the right thing"?

NOTE: `ashift=12` means that the pool is configured to use a 4K (4096-byte) sector size. In ZFS terminology, this is sometimes referred to as "ashift 12" or "4K alignment."

Why is all of this not happening automatically?

More information:

* Bits inside by René Rebe: [You DO NOT use your NVME SSDs to their BEST PERFORMANCE: THIS is the SIMPLE FIX!](https://www.youtube.com/watch?v=7f4f7BvmBqc)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.