NVMe SSD 突然變慢(讀取和寫入)

NVMe SSD 突然變慢(讀取和寫入)

更新1:我將這台伺服器重新啟動到 HDD 上安裝的另一個 Ubuntu(也是 20.04 LTS),並hdparm -tT顯示超過 1 GB/s 的合理效能。現在我傾向於相信這是一個軟體問題 - SSD 本身應該沒問題。

更新2:令人困惑的是,atop沒有顯示任何奇怪的磁碟活動,但磁碟仍然「非常活躍」。很多z_wr_iss線程偶爾會隨機出現。

在頂上


這是安裝在桌上型電腦上的 HP SSD EX920 1TB,作為個人伺服器全天候 (24/7) 運作。一年多來效果很好,直到上週,突然,進程開始隨機進入 D(不間斷睡眠)狀態。此驅動器僅半滿並定期修剪。

HDparm 測試結果很荒謬(/dev/nvme0有問題的是 SSD,/dev/sda是另一個 HDD)(闡明:HDparm程式正常,沒有故障,SSD本身有錯誤效能,只有幾MB/s):

root@ubuntu:~# hdparm -Tt /dev/nvme0n1
/dev/nvme0n1:
 Timing cached reads:   15670 MB in  2.00 seconds = 7839.79 MB/sec
 HDIO_DRIVE_CMD(identify) failed: Inappropriate ioctl for device
 Timing buffered disk reads:   8 MB in  3.61 seconds =   2.22 MB/sec

root@ubuntu:~# hdparm -Tt /dev/sda
/dev/sda:
 Timing cached reads:   29014 MB in  2.00 seconds = 14525.03 MB/sec
 Timing buffered disk reads: 454 MB in  3.01 seconds = 150.67 MB/sec

不過,SMART 資訊看起來還不錯:

smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-56-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Number:                       HP SSD EX920 1TB
Serial Number:                      xxxxxxxxxxxxxxx
Firmware Version:                   SVN139B
PCI Vendor ID:                      0x1dee
PCI Vendor Subsystem ID:            0x126f
IEEE OUI Identifier:                0x000000
Controller ID:                      1
Number of Namespaces:               1
Namespace 1 Size/Capacity:          1,024,209,543,168 [1.02 TB]
Namespace 1 Formatted LBA Size:     512
Local Time is:                      Mon Dec  7 13:54:15 2020 CST
Firmware Updates (0x14):            2 Slots, no Reset required
Optional Admin Commands (0x0016):   Format Frmw_DL Self_Test
Optional NVM Commands (0x005f):     Comp Wr_Unc DS_Mngmt Wr_Zero Sav/Sel_Feat Timestmp
Maximum Data Transfer Size:         64 Pages
Warning  Comp. Temp. Threshold:     70 Celsius
Critical Comp. Temp. Threshold:     80 Celsius

Supported Power States
St Op     Max   Active     Idle   RL RT WL WT  Ent_Lat  Ex_Lat
 0 +     9.00W       -        -    0  0  0  0        0       0
 1 +     4.60W       -        -    1  1  1  1        0       0
 2 +     3.80W       -        -    2  2  2  2        0       0
 3 -   0.0450W       -        -    3  3  3  3     2000    2000
 4 -   0.0040W       -        -    4  4  4  4     6000    8000

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

=== START OF SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

SMART/Health Information (NVMe Log 0x02)
Critical Warning:                   0x00
Temperature:                        54 Celsius
Available Spare:                    100%
Available Spare Threshold:          10%
Percentage Used:                    0%
Data Units Read:                    31,682,199 [16.2 TB]
Data Units Written:                 50,028,403 [25.6 TB]
Host Read Commands:                 538,395,033
Host Write Commands:                1,279,795,487
Controller Busy Time:               20,480
Power Cycles:                       1,012
Power On Hours:                     7,879
Unsafe Shutdowns:                   40
Media and Data Integrity Errors:    0
Error Information Log Entries:      0
Warning  Comp. Temperature Time:    7
Critical Comp. Temperature Time:    0
Thermal Temp. 1 Transition Count:   8
Thermal Temp. 2 Transition Count:   2
Thermal Temp. 1 Total Time:         1118
Thermal Temp. 2 Total Time:         214

Error Information (NVMe Log 0x01, max 256 entries)
No Errors Logged

嘗試存取hdparm -B此 NVMe SSD 上的 APM 資訊 ( ) 只會給出「裝置的 ioctl 不適當」。

另外,我有不是發現任何損壞的資料(全部完好),只是讀/寫速度過慢。

此磁碟機有三個分割區:一個 EFI 系統分割區(幾百 MiB)、一個作為根檔案系統的 ext4 分割區(128 GiB),其餘的則儲存在 ZFS 中。在各個分區上運行hdparm -tT會產生類似的結果(讀取速度低於 10 MB/s)。所有這些分割區都與 1 MiB 邊界對齊。

接下來我該做什麼才能恢復該 SSD 的「正常」速度?或者我應該換一個?

答案1

這是一個 nvme 驅動器,您可能需要安裝 nvme-cli 來檢查 APM 設置,以及 ioctl 不起作用的原因。 z_wr_iss 執行緒是 Linux 上的 ZFS 寫入執行緒。這些緩衝讀取非常慢,也許您系統上的記憶體很慢?或者可能是 ZFS 調整問題。

相關內容