先决条件
我们有一个 FreeNAS 系统,其池由 5 个“三向镜像”组成。每个镜像的磁盘来自不同的供应商,但具有相同的“纸面”性能特征。
泳池布局:
Tank0
mirror-0
Western Digital WDC WD20SPZX (2TB, 128MB Cache, 5400 RPM)
Seagate ST2000LM015 (2TB, 128MB Cache, 5400 RPM)
Toshiba HDWL120 (2TB, 128MB Cache, 5400 RPM)
mirror-1
Western Digital WDC WD20SPZX (2TB, 128MB Cache, 5400 RPM)
Seagate ST2000LM015 (2TB, 128MB Cache, 5400 RPM)
Toshiba HDWL120 (2TB, 128MB Cache, 5400 RPM)
mirror-2
Western Digital WDC WD20SPZX (2TB, 128MB Cache, 5400 RPM)
Seagate ST2000LM015 (2TB, 128MB Cache, 5400 RPM)
Toshiba HDWL120 (2TB, 128MB Cache, 5400 RPM)
mirror-3
Western Digital WDC WD20SPZX (2TB, 128MB Cache, 5400 RPM)
Seagate ST2000LM015 (2TB, 128MB Cache, 5400 RPM)
Toshiba HDWL120 (2TB, 128MB Cache, 5400 RPM)
mirror-4
Western Digital WDC WD20SPZX (2TB, 128MB Cache, 5400 RPM)
Seagate ST2000LM015 (2TB, 128MB Cache, 5400 RPM)
Toshiba HDWL120 (2TB, 128MB Cache, 5400 RPM)
logs
mirror-5
Seagate ST200FM0002 (200GB SAS SSD)
Seagate ST200FM0002 (200GB SAS SSD)
cache
Samsung 850 PRO (512GB SATA SSD)
每个镜像选择 3 个不同的驱动器供应商,以尽量降低特定型号驱动器发生故障的风险。在创建镜像时插入了 WD 和 Seagate 驱动器,后来添加了 Toshiba 驱动器以形成三向镜像。
所有驱动器都安装在 HP SE326M1 服务器的背板上。背板本身连接到装有 IT 模式固件的 HP H220 HBA。
ZFS 能够直接与每个驱动器交互,无需任何 raid 卡。
驱动器的智能值
西部数据
=== START OF INFORMATION SECTION ===
Device Model: WDC WD20SPZX-00CRAT0
Serial Number: WD-WXA1E17A5SPC
LU WWN Device Id: 5 0014ee 65db69aed
Firmware Version: 01.01A01
User Capacity: 2,000,398,934,016 bytes [2.00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 5400 rpm
Form Factor: 2.5 inches
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: ACS-3 T13/2161-D revision 5
SATA Version is: SATA 3.1, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is: Wed Apr 24 13:04:40 2019 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
General SMART Values:
Offline data collection status: (0x00) Offline data collection activity
was never started.
Auto Offline Data Collection: Disabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: (21120) seconds.
Offline data collection
capabilities: (0x71) SMART execute Offline immediate.
No Auto Offline data collection support.
Suspend Offline collection upon new
command.
No Offline surface scan supported.
Self-test supported.
Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 2) minutes.
Extended self-test routine
recommended polling time: ( 368) minutes.
Conveyance self-test routine
recommended polling time: ( 3) minutes.
SCT capabilities: (0x3035) SCT Status supported.
SCT Feature Control supported.
SCT Data Table supported.
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 0
3 Spin_Up_Time 0x0027 100 253 021 Pre-fail Always - 0
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 4
5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
7 Seek_Error_Rate 0x002e 200 200 000 Old_age Always - 0
9 Power_On_Hours 0x0032 091 091 000 Old_age Always - 7047
10 Spin_Retry_Count 0x0032 100 253 000 Old_age Always - 0
11 Calibration_Retry_Count 0x0032 100 253 000 Old_age Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 4
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 2
193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always - 20
194 Temperature_Celsius 0x0022 111 109 000 Old_age Always - 36
196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 100 253 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0008 100 253 000 Old_age Offline - 0
SMART Error Log Version: 1
No Errors Logged
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Completed without error 00% 2 -
SMART Selective self-test log data structure revision number 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
希捷
=== START OF INFORMATION SECTION ===
Model Family: Seagate Barracuda 2.5 5400
Device Model: ST2000LM015-2E8174
Serial Number: WDZBHCXK
LU WWN Device Id: 5 000c50 0acdec7df
Firmware Version: SDM1
User Capacity: 2,000,398,934,016 bytes [2.00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 5400 rpm
Form Factor: 2.5 inches
Device is: In smartctl database [for details use: -P show]
ATA Version is: ACS-3 T13/2161-D revision 3b
SATA Version is: SATA 3.1, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is: Wed Apr 24 13:05:23 2019 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
General SMART Values:
Offline data collection status: (0x00) Offline data collection activity
was never started.
Auto Offline Data Collection: Disabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: ( 0) seconds.
Offline data collection
capabilities: (0x71) SMART execute Offline immediate.
No Auto Offline data collection support.
Suspend Offline collection upon new
command.
No Offline surface scan supported.
Self-test supported.
Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 1) minutes.
Extended self-test routine
recommended polling time: ( 331) minutes.
Conveyance self-test routine
recommended polling time: ( 2) minutes.
SCT capabilities: (0x3035) SCT Status supported.
SCT Feature Control supported.
SCT Data Table supported.
SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000f 078 064 006 Pre-fail Always - 57137976
3 Spin_Up_Time 0x0003 100 100 000 Pre-fail Always - 0
4 Start_Stop_Count 0x0032 100 100 020 Old_age Always - 4
5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always - 0
7 Seek_Error_Rate 0x000f 086 060 045 Pre-fail Always - 426983688
9 Power_On_Hours 0x0032 092 092 000 Old_age Always - 7054 (57 92 0)
10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always - 4
184 End-to-End_Error 0x0032 100 100 099 Old_age Always - 0
187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0
188 Command_Timeout 0x0032 100 100 000 Old_age Always - 0
189 High_Fly_Writes 0x003a 100 100 000 Old_age Always - 0
190 Airflow_Temperature_Cel 0x0022 067 064 040 Old_age Always - 33 (Min/Max 23/36)
191 G-Sense_Error_Rate 0x0032 100 100 000 Old_age Always - 0
192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 2
193 Load_Cycle_Count 0x0032 100 100 000 Old_age Always - 15
194 Temperature_Celsius 0x0022 033 040 000 Old_age Always - 33 (0 23 0 0 0)
197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0
240 Head_Flying_Hours 0x0000 100 253 000 Old_age Offline - 7054 (68 231 0)
241 Total_LBAs_Written 0x0000 100 253 000 Old_age Offline - 74035391620
242 Total_LBAs_Read 0x0000 100 253 000 Old_age Offline - 65426356249
254 Free_Fall_Sensor 0x0032 100 100 000 Old_age Always - 0
SMART Error Log Version: 1
No Errors Logged
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Completed without error 00% 2 -
SMART Selective self-test log data structure revision number 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
东芝
=== START OF INFORMATION SECTION ===
Device Model: TOSHIBA HDWL120
Serial Number: 88K6P0OYT
LU WWN Device Id: 5 000039 8b2409181
Firmware Version: JT000A
User Capacity: 2,000,398,934,016 bytes [2.00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 5400 rpm
Form Factor: 2.5 inches
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: ACS-3 T13/2161-D revision 5
SATA Version is: SATA 3.3, 6.0 Gb/s (current: 1.5 Gb/s)
Local Time is: Wed Apr 24 13:09:44 2019 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
General SMART Values:
Offline data collection status: (0x00) Offline data collection activity
was never started.
Auto Offline Data Collection: Disabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: ( 120) seconds.
Offline data collection
capabilities: (0x5b) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
No Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 2) minutes.
Extended self-test routine
recommended polling time: ( 322) minutes.
SCT capabilities: (0x003d) SCT Status supported.
SCT Error Recovery Control supported.
SCT Feature Control supported.
SCT Data Table supported.
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000b 100 100 050 Pre-fail Always - 0
2 Throughput_Performance 0x0005 100 100 050 Pre-fail Offline - 0
3 Spin_Up_Time 0x0027 100 100 001 Pre-fail Always - 1621
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 2
5 Reallocated_Sector_Ct 0x0033 100 100 050 Pre-fail Always - 0
7 Seek_Error_Rate 0x000b 100 100 050 Pre-fail Always - 0
8 Seek_Time_Performance 0x0005 100 100 050 Pre-fail Offline - 0
9 Power_On_Hours 0x0032 092 092 000 Old_age Always - 3577
10 Spin_Retry_Count 0x0033 100 100 030 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 2
191 G-Sense_Error_Rate 0x0032 100 100 000 Old_age Always - 0
192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 0
193 Load_Cycle_Count 0x0032 099 099 000 Old_age Always - 16896
194 Temperature_Celsius 0x0022 100 100 000 Old_age Always - 30 (Min/Max 24/34)
196 Reallocated_Event_Count 0x0032 100 100 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 100 100 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 253 000 Old_age Always - 0
220 Disk_Shift 0x0002 100 100 000 Old_age Always - 0
222 Loaded_Hours 0x0032 092 092 000 Old_age Always - 3540
223 Load_Retry_Count 0x0032 100 100 000 Old_age Always - 0
224 Load_Friction 0x0022 100 100 000 Old_age Always - 0
226 Load-in_Time 0x0026 100 100 000 Old_age Always - 268
240 Head_Flying_Hours 0x0001 100 100 001 Pre-fail Offline - 0
SMART Error Log Version: 1
No Errors Logged
SMART Self-test log structure revision number 1
No self-tests have been logged. [To run self-tests, use: smartctl -t]
SMART Selective self-test log data structure revision number 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
凸轮控制输出
camcontrol identify <dev>
西部数据
pass6: <WDC WD20SPZX-00CRAT0 01.01A01> ACS-3 ATA SATA 3.x device
pass6: 300.000MB/s transfers, Command Queueing Enabled
protocol ATA/ATAPI-10 SATA 3.x
device model WDC WD20SPZX-00CRAT0
firmware revision 01.01A01
serial number WD-WX91E17FJNXD
WWN 50014ee6086142a7
cylinders 16383
heads 16
sectors/track 63
sector size logical 512, physical 4096, offset 0
LBA supported 268435455 sectors
LBA48 supported 3907029168 sectors
PIO supported PIO4
DMA supported WDMA2 UDMA6
media RPM 5400
Feature Support Enabled Value Vendor
read ahead yes yes
write cache yes yes
flush cache yes yes
overlap no
Tagged Command Queuing (TCQ) no no
Native Command Queuing (NCQ) yes 32 tags
NCQ Queue Management no
NCQ Streaming no
Receive & Send FPDMA Queued no
SMART yes yes
microcode download yes yes
security yes no
power management yes yes
advanced power management yes no 254/0xFE
automatic acoustic management no no
media status notification no no
power-up in Standby yes no
write-read-verify no no
unload yes yes
general purpose logging yes yes
free-fall no no
Data Set Management (DSM/TRIM) yes
DSM - max 512byte blocks yes 10
DSM - deterministic read yes any value
Host Protected Area (HPA) no
希捷
pass4: <ST2000LM015-2E8174 SDM1> ACS-3 ATA SATA 3.x device
pass4: 300.000MB/s transfers, Command Queueing Enabled
protocol ATA/ATAPI-10 SATA 3.x
device model ST2000LM015-2E8174
firmware revision SDM1
serial number WDZBHCXK
WWN 5000c500acdec7df
cylinders 16383
heads 16
sectors/track 63
sector size logical 512, physical 4096, offset 0
LBA supported 268435455 sectors
LBA48 supported 3907029168 sectors
PIO supported PIO4
DMA supported WDMA2 UDMA6
media RPM 5400
Feature Support Enabled Value Vendor
read ahead yes yes
write cache yes yes
flush cache yes yes
overlap no
Tagged Command Queuing (TCQ) no no
Native Command Queuing (NCQ) yes 32 tags
NCQ Queue Management no
NCQ Streaming no
Receive & Send FPDMA Queued no
SMART yes yes
microcode download yes yes
security yes no
power management yes yes
advanced power management yes no 0/0x00
automatic acoustic management no no
media status notification no no
power-up in Standby yes no
write-read-verify yes no 0/0x0
unload yes yes
general purpose logging yes yes
free-fall no no
Data Set Management (DSM/TRIM) no
Host Protected Area (HPA) yes no 3907029168/3907029168
HPA - Security no
东芝
pass16: <TOSHIBA HDWL120 JT000A> ACS-3 ATA SATA 3.x device
pass16: 150.000MB/s transfers, Command Queueing Enabled
protocol ATA/ATAPI-10 SATA 3.x
device model TOSHIBA HDWL120
firmware revision JT000A
serial number 88K6P0O0T
WWN 50000398b240915f
cylinders 16383
heads 16
sectors/track 63
sector size logical 512, physical 4096, offset 0
LBA supported 268435455 sectors
LBA48 supported 3907029168 sectors
PIO supported PIO4
DMA supported WDMA2 UDMA5
media RPM 5400
Feature Support Enabled Value Vendor
read ahead yes yes
write cache yes yes
flush cache yes yes
overlap no
Tagged Command Queuing (TCQ) no no
Native Command Queuing (NCQ) yes 32 tags
NCQ Queue Management no
NCQ Streaming no
Receive & Send FPDMA Queued no
SMART yes yes
microcode download yes yes
security yes no
power management yes yes
advanced power management yes yes 128/0x80
automatic acoustic management no no
media status notification no no
power-up in Standby yes no
write-read-verify yes no 0/0x0
unload yes yes
general purpose logging yes yes
free-fall no no
Data Set Management (DSM/TRIM) no
Host Protected Area (HPA) yes no 3907029168/3907029168
HPA - Security no
症状
该池本身几个月来一直很稳定。但我们观察到供应商驱动器上存在巨大的性能差异。
磁盘繁忙:WD 硬盘大多数时间都处于繁忙状态(95-100% 磁盘繁忙),而其他硬盘(Seagate 和 Toshiba)最多为 30%。
磁盘延迟:WD 硬盘的写入和删除延迟在 2000 到 8000 毫秒之间,而其他硬盘(Seagate 和 Toshiba)的延迟在 20-50 毫秒范围内。
同一供应商的所有驱动器的行为都类似。
- 此系统中的所有 WD 硬盘都表现出不佳的性能。图表几乎相同
- 所有 Seagate 和 Toshiba 硬盘在其供应商之间显示的性能数据几乎相同。
- 希捷和东芝的表现几乎相同,只有很小的差别。
问题)
- 为什么 WD 硬盘在这种设置下性能如此糟糕。
- 在选择“相同的驱动特性”时我是否遗漏了什么?
- 是的:只有 WD 支持 DSM/TRIM!有关 WD 硬盘上的 TRIM 的信息
- 是否有可以让 WD-Drives 表现更好的设置?
- 为什么 WD 硬盘支持 DSM/TRIM 而其他硬盘不支持?
- 有没有办法禁用该功能来进行测试?
答案1
原因:西部数据硬盘支持 TRIM
除 Seagate 和 Toshiba 外,WD-drive 还支持 TRIM:Data Set Management (DSM/TRIM) yes
FreeBSD (FreeNAS) 上的 ZFS 也支持 TRIM。WD 驱动器有很多工作要做,以整理已删除的数据。
解决方案:禁用 TRIM
1) 我尝试在运行时禁用驱动器本身的 TRIM,但结果导致内核崩溃。请自行承担风险!
sysctl kern.cam.da.6.delete_method=DISABLE
2)禁用 ZFS 的 TRIM确实成功了,但是我的 Cache-SSD 没有 TRIM。
转到 FreeNAS - 系统 - 可调参数并单击“添加可调参数”
Variable: vfs.zfs.trim.enabled
Value: 0
Type: Loader
Enabled: checked
重启后,ZFS 不再进行 TRIM。存储的反应速度更快。“磁盘繁忙”保持在较高水平,但“磁盘延迟”从秒降至毫秒!
“待处理的 I/O 请求”从平均 130 个下降到不超过 20 个。
编辑:上次 Scrub 大约花费11 小时而前一个24 天。