Configuring for max performance

THIS IS A DATA DESTRUCTIVE PROCESS

Traditional drives typically used 512k physical sector sizes. Newer hard drives and SSDs use 4k sectors, but often emulate 512k logical sectors (called 512e) for compatibility. SSD’s specifically sometimes ship with 512e to increase compatibility with operating systems and the ability to clone your old drive to the new SSD during migrations. When emulating 512k logical sectors on an HD or SSD that uses 4k physical native sectors, an operation that writes 4k will result in 4 operations instead of 1. This increases overhead and could result in reduced IO and speed, as well as create more wear on the SSD when performing writes. Some HDs and SSDs come with utilities or tools to change the sector size of the drive. I highly recommend changing it to it’s native sector size.

https://www.stephenwagner.com/2020/06/06/freenas-truenas-zfs-optimizations-considerations-ssd-nvme/

https://downloadcenter.intel.com/download/30065?v=t

[liveuser@localhost-live ~]$ cd Downloads/Intel_SSD_DCT_3.0.27_Linux/
[liveuser@localhost-live Intel_SSD_DCT_3.0.27_Linux]$ sudo su
[root@localhost-live Intel_SSD_DCT_3.0.27_Linux]# rpm -ivh isdct-3.0.27.400-1.x86_64.rpm
[root@localhost-live Intel_SSD_DCT_3.0.27_Linux]# isdct show -intelssd
- Intel SSD DC P4510 Series BTLJ910004N31P0FGN -

Bootloader : 0172
DevicePath : /dev/nvme0n1
DeviceStatus : Healthy
Firmware : VDV10170
FirmwareUpdateAvailable : The selected drive contains current firmware as of this tool release.
Index : 0
ModelNumber : INTEL SSDPE2KX010T8
ProductFamily : Intel SSD DC P4510 Series
SerialNumber : BTLJ910004N31P0FGN

https://www.intel.com/content/dam/support/us/en/documents/memory-and-storage/Intel_SSD_DCT_3_0_x_User_Guide.pdf

Update Firmware:

[root@localhost-live Intel_SSD_DCT_3.0.27_Linux]# isdct load -intelssd 0
WARNING! You have selected to update the drives firmware! 
Proceed with the update? (Y|N): y
Updating firmware...

- Intel SSD DC P4510 Series BTLJ910004N31P0FGN -

Status : The selected drive contains current firmware as of this tool release.

REBOOT

Get LBA Format identifiers:
Note: Notice (Best performance) under LBA Format 1

[root@localhost-live Intel_SSD_DCT_3.0.27_Linux]# isdct show -intelssd 0 -identify

- Identify Namespace BTLJ910004N31P0FGN -

- Byte 0-7 -

Namespace Size : 1953525168

- Byte 8-15 -

Namespace Capacity : 1953525168

- Byte 16-23 -

Namespace Utilization : 1953525168

- Byte 24 -

Namespace Features : 0
Bit 2 - Unwritten Logical Block Error Support : 0
Bit 2 - NAWUN, NAWUPF, NACWU Fields Support : 0
Bit 0 - Thin Provisioning Support : 0

- Byte 25 -

Number of LBA Formats : 1

- Byte 26 -

Formatted LBA Size : 0
Bit 7:5 - Reserved : 0
Bit 4 - Metadata transfer bit : 0
Bit 0:3 - LBA Format Support : 0

- Byte 27 -

Metadata Capabilities : 0
Bit 7:2 - Reserved : 0
Bit 1 - Metadata transfered as part of a separate buffer support : 0
Bit 0 - Metadata transfered part of extended data LBA Support : 0

- Byte 28 -

End-to-end Data Protection Capabilities : 0
Bit 7:5 - Reserved : 0
Bit 4 - Protection Info transfered as last 8 bytes of metadata Support : 0
Bit 3 - Protection Info transfered as first 8 bytes of metadata Support : 0
Bit 2 - Protection Type 3 Support : 0
Bit 1 - Protection Type 2 Support : 0
Bit 0 - Protection Type 1 Support : 0

- Byte 29 -

End-to-end Data Protection Type Settings : 0
Bit 7:4 - Reserved : 0
Bit 3 - Protection Information Transfer : 0 (Transferred as the last eight bytes of metadata.)
Bit 2:0 - Protection Type Information : 0 (Protection Information is not enabled)

- Byte 30 -

Namespace Multi-path I/O and Sharing Capabilities : 0

- Byte 31 -

Reservation Capabilities : 0
Bit 6 - Exclusive Access All Registrants supported : 0
Bit 5 - Write Exclusive All Registrants supported : 0
Bit 4 - Exclusive Access Registrants Only supported  : 0
Bit 3 - Write Exclusive Registrants Only supported : 0
Bit 2 - Exclusive Access supported : 0
Bit 1 - Write Exclusive supported : 0
Bit 0 - Protection Type 1 Support : 0

- Byte 32 -

Format Progress Indicator : 0
Bit 7 - Supported : 0
Bit 6:0 - Percentage Remaining : 0

- Byte 33 -

Reserved : Value not found

- Byte 34-35 -

Namespace Atomic Write Unit Normal : 0

- Byte 36-37 -

Namespace Atomic Write Unit Power Fail : 0

- Byte 38-39 -

Namespace Atomic Compare & Write Unit : 0

- Byte 40-41 -

Namespace Atomic Boundary Size Normal : 0

- Byte 42-43 -

Namespace Atomic Boundary Offset : 0

- Byte 44-45 -

Namespace Atomic Boundary Size Power Fail : 0

- Byte 46-47 -

Reserved : Value not found

- Byte 48-63 -

NVM Capacity : 0000000000000000000000E8E0DB6000

- Byte 64-103 -

Reserved : Value not found

- Byte 104-119 -

Namespace Globally Unique Identifier : 515089A00CE4D25C0000000100000001

- Byte 120-127 -

IEEE Extended Unique Identifier : 000189A00CE4D25C

- Byte 131 -

LBA Format 0 Support : 2090000
Bit 31:26 - Reserved : Value not found
Bit 25:24 - Relative Performance : 0x2 (Good performance)
Bit 23:16 - LBA Data Size : 09
Bit 15:0 - Metadata Size : 0000

- Byte 135 -

LBA Format 1 Support : C0000
Bit 31:26 - Reserved : Value not found
Bit 25:24 - Relative Performance : 0x0 (Best performance)
Bit 23:16 - LBA Data Size : 0C
Bit 15:0 - Metadata Size : 0000

- Byte 139 -

LBA Format 2 Support : 0
Bit 31:26 - Reserved : Value not found
Bit 25:24 - Relative Performance : 0x0 (Best performance)
Bit 23:16 - LBA Data Size : 00
Bit 15:0 - Metadata Size : 0000

- Byte 143 -

LBA Format 3 Support : 0
Bit 31:26 - Reserved : Value not found
Bit 25:24 - Relative Performance : 0x0 (Best performance)
Bit 23:16 - LBA Data Size : 00
Bit 15:0 - Metadata Size : 0000

- Byte 147 -

LBA Format 4 Support : 0
Bit 31:26 - Reserved : Value not found
Bit 25:24 - Relative Performance : 0x0 (Best performance)
Bit 23:16 - LBA Data Size : 00
Bit 15:0 - Metadata Size : 0000

- Byte 151 -

LBA Format 5 Support : 0
Bit 31:26 - Reserved : Value not found
Bit 25:24 - Relative Performance : 0x0 (Best performance)
Bit 23:16 - LBA Data Size : 00
Bit 15:0 - Metadata Size : 0000

- Byte 155 -

LBA Format 6 Support : 0
Bit 31:26 - Reserved : Value not found
Bit 25:24 - Relative Performance : 0x0 (Best performance)
Bit 23:16 - LBA Data Size : 00
Bit 15:0 - Metadata Size : 0000

- Byte 159 -

LBA Format 7 Support : 0
Bit 31:26 - Reserved : Value not found
Bit 25:24 - Relative Performance : 0x0 (Best performance)
Bit 23:16 - LBA Data Size : 00
Bit 15:0 - Metadata Size : 0000

- Byte 163 -

LBA Format 8 Support : 0
Bit 31:26 - Reserved : Value not found
Bit 25:24 - Relative Performance : 0x0 (Best performance)
Bit 23:16 - LBA Data Size : 00
Bit 15:0 - Metadata Size : 0000

- Byte 167 -

LBA Format 9 Support : 0
Bit 31:26 - Reserved : Value not found
Bit 25:24 - Relative Performance : 0x0 (Best performance)
Bit 23:16 - LBA Data Size : 00
Bit 15:0 - Metadata Size : 0000

- Byte 171 -

LBA Format 10 Support : 0
Bit 31:26 - Reserved : Value not found
Bit 25:24 - Relative Performance : 0x0 (Best performance)
Bit 23:16 - LBA Data Size : 00
Bit 15:0 - Metadata Size : 0000

- Byte 175 -

LBA Format 11 Support : 0
Bit 31:26 - Reserved : Value not found
Bit 25:24 - Relative Performance : 0x0 (Best performance)
Bit 23:16 - LBA Data Size : 00
Bit 15:0 - Metadata Size : 0000

- Byte 179 -

LBA Format 12 Support : 0
Bit 31:26 - Reserved : Value not found
Bit 25:24 - Relative Performance : 0x0 (Best performance)
Bit 23:16 - LBA Data Size : 00
Bit 15:0 - Metadata Size : 0000

- Byte 183 -

LBA Format 13 Support : 0
Bit 31:26 - Reserved : Value not found
Bit 25:24 - Relative Performance : 0x0 (Best performance)
Bit 23:16 - LBA Data Size : 00
Bit 15:0 - Metadata Size : 0000

- Byte 187 -

LBA Format 14 Support : 0
Bit 31:26 - Reserved : Value not found
Bit 25:24 - Relative Performance : 0x0 (Best performance)
Bit 23:16 - LBA Data Size : 00
Bit 15:0 - Metadata Size : 0000

- Byte 191 -

LBA Format 15 Support : 0
Bit 31:26 - Reserved : Value not found
Bit 25:24 - Relative Performance : 0x0 (Best performance)
Bit 23:16 - LBA Data Size : 00
Bit 15:0 - Metadata Size : 0000

In this case it’s LBAFormat 1, some of their drives support many different sector sizes so this depends on the model:

[root@localhost-live Intel_SSD_DCT_3.0.27_Linux]# isdct show -d NumLBAFormats -intelssd 0

- Intel SSD DC P4510 Series BTLJ910004N31P0FGN -

NumLBAFormats : 1

Note: The above is a zero based index

Current LBA Format:

[root@localhost-live Intel_SSD_DCT_3.0.27_Linux]# isdct show -d LBAFormat -intelssd 0

- Intel SSD DC P4510 Series BTLJ910004N31P0FGN -

LBAFormat : 0

Current Sector Size:

[root@localhost-live Intel_SSD_DCT_3.0.27_Linux]# isdct show -d SectorSize -intelssd 0

- Intel SSD DC P4510 Series BTLJ910004N31P0FGN -

SectorSize : 512

Change to 4K block size:

[root@localhost-live Intel_SSD_DCT_3.0.27_Linux]# isdct start -intelssd 0 -NVMeFormat LBAformat=1 SecureEraseSetting=0 ProtectionInformation=0 MetaDataSettings=0
WARNING! You have selected to format the drive! 
Proceed with the format? (Y|N): y
Formatting...(This can take several minutes to complete)

- Intel SSD DC P4510 Series BTLJ910004N31P0FGN -

Status : NVMeFormat successful.

New Sector Size:

[root@localhost-live Intel_SSD_DCT_3.0.27_Linux]# isdct show -d SectorSize -intelssd 0

- Intel SSD DC P4510 Series BTLJ910004N31P0FGN -

SectorSize : 4096

Confirm all sector sizes:

[root@localhost-live Intel_SSD_DCT_3.0.27_Linux]# isdct show -d SectorSize -intelssd 

- Intel SSD DC P4510 Series BTLJ910004N31P0FGN -

SectorSize : 4096

- Intel SSD DC P4510 Series PHLJ006501LS1P0FGN -

SectorSize : 4096

- Intel SSD DC P4510 Series PHLJ006501VK1P0FGN -

SectorSize : 4096

- Intel SSD DC P4510 Series BTLJ910009871P0FGN -

SectorSize : 4096

- Intel SSD DC P4510 Series BTLJ91000A5Q1P0FGN -

SectorSize : 4096

- Intel SSD DC P4510 Series BTLJ910004R81P0FGN -

SectorSize : 4096

- Intel SSD DC P4510 Series BTLJ910004NP1P0FGN -

SectorSize : 4096

- Intel SSD DC P4510 Series BTLJ910006FJ1P0FGN -

SectorSize : 4096

- Intel SSD DC P4510 Series PHLJ006502ZZ1P0FGN -

SectorSize : 4096

- Intel SSD DC P4510 Series PHLJ006502YU1P0FGN -

SectorSize : 4096

- Intel SSD DC P4510 Series PHLJ006503BG1P0FGN -

SectorSize : 4096

- Intel SSD DC P4510 Series PHLJ0065039J1P0FGN -

SectorSize : 4096

List NVMe (disks) in TrueNAS:

root@GigabyteTrueNAS[~]# geom disk list
Geom name: nvd0
Providers:
1. Name: nvd0
   Mediasize: 1000204886016 (932G)
   Sectorsize: 4096
   Stripesize: 131072
   Stripeoffset: 0
   Mode: r0w0

Query all ZFS pools for ashift:

zdb -U /data/zfs/zpool.cache | grep -e ashift