新安装的 NVMe 速度很慢

新安装的 NVMe 速度很慢

我刚刚安装了一台 HP z230 Xeon E3 1225 v3 机器,它配备了 HP TurboDrive G1 和 Seagate Firecuda NVMe SSD。我原本预计读取速度为 2-3000MB/s,但实际速度却远低于这个数字。我并不太在意这里或那里的几百MB/s,但我看到的是 300-400MB/s,这让我觉得有些配置有误。

$ uname -ra
Linux host 5.4.0-74-generic #83-Ubuntu SMP Sat May 8 02:35:39 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.2 LTS
Release:    20.04
Codename:   focal

简单分区方案,无加密

Disk /dev/nvme0n1: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: Seagate FireCuda 510 SSD ZP1000GM30031
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 521B5816-364D-4D9B-B9B5-5F7C17E272C9

Device         Start        End    Sectors   Size Type
/dev/nvme0n1p1  2048 1953521663 1953519616 931.5G Linux filesystem

hdparm 显示出比预期低近一个数量级:

$ hdparm -tT --direct /dev/nvme0n1

/dev/nvme0n1:
 Timing O_DIRECT cached reads:   722 MB in  2.00 seconds = 360.94 MB/sec
 HDIO_DRIVE_CMD(identify) failed: Inappropriate ioctl for device
 Timing O_DIRECT disk reads: 1098 MB in  3.00 seconds = 365.60 MB/sec

使用 grub 设置:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset nvme_core.default_ps_max_latency_us=200 scsi_mod.use_blk_mq=1"

调度器

$ cat /sys/block/nvme0n1/queue/scheduler
[none] mq-deadline

fstab:

/dev/disk/by-uuid/26ccd344-b8f1-4101-af69-6571bb600a87 / ext4 defaults,noatime,nodiratime 0 0

智能控制:

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

=== START OF INFORMATION SECTION ===
Model Number:                       Seagate FireCuda 510 SSD ZP1000GM30031
Serial Number:                      7W1004GW
Firmware Version:                   STPSC014
PCI Vendor/Subsystem ID:            0x1bb1
IEEE OUI Identifier:                0x6479a7
Total NVM Capacity:                 1,000,204,886,016 [1.00 TB]
Unallocated NVM Capacity:           0
Controller ID:                      1
Number of Namespaces:               1
Namespace 1 Size/Capacity:          1,000,204,886,016 [1.00 TB]
Namespace 1 Formatted LBA Size:     512
Namespace 1 IEEE EUI-64:            6479a7 486f001b5c
Local Time is:                      Mon Jun 14 20:17:02 2021 UTC
Firmware Updates (0x1e):            7 Slots, no Reset required
Optional Admin Commands (0x0017):   Security Format Frmw_DL Self_Test
Optional NVM Commands (0x005d):     Comp DS_Mngmt Wr_Zero Sav/Sel_Feat Timestmp
Maximum Data Transfer Size:         512 Pages
Warning  Comp. Temp. Threshold:     75 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.48W       -        -    0  0  0  0        0       0
 1 +     6.45W       -        -    1  1  1  1        0       0
 2 +     4.93W       -        -    2  2  2  2        0       0
 3 -   0.0490W       -        -    3  3  3  3     2000    2000
 4 -   0.0018W       -        -    4  4  4  4    25000   25000

Supported LBA Sizes (NSID 0x1)
Id Fmt  Data  Metadt  Rel_Perf
 0 +     512       0         2
 1 -    4096       0         1

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

SMART/Health Information (NVMe Log 0x02)
Critical Warning:                   0x00
Temperature:                        35 Celsius
Available Spare:                    100%
Available Spare Threshold:          5%
Percentage Used:                    0%
Data Units Read:                    206,765 [105 GB]
Data Units Written:                 209,598 [107 GB]
Host Read Commands:                 14,114,924
Host Write Commands:                11,352,976
Controller Busy Time:               11
Power Cycles:                       25
Power On Hours:                     34
Unsafe Shutdowns:                   20
Media and Data Integrity Errors:    0
Error Information Log Entries:      6
Warning  Comp. Temperature Time:    0
Critical Comp. Temperature Time:    0

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

结盟:

$ sudo parted /dev/nvme0n1
GNU Parted 3.3
Using /dev/nvme0n1
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) align-check opt 1
1 aligned

至此,我的实验就到此结束了。我很想找到其他东西来尝试,或者看看 SSD 是否出了问题。(虽然它是全新的)

谢谢,克里斯

相关内容