
我有一台伺服器,上面駐留一個訪問量較高的網路應用程式。
它有 2 個 HDD、64MB 緩衝區、7200 RPM 的 raid1。
今天它開始拋出以下錯誤:
kernel: ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
kernel: ata2.00: cmd b0/d0:01:00:4f:c2/00:00:00:00:00/00 tag 0 pio 512 in
kernel: res 40/00:00:00:4f:c2/00:00:00:00:00/00 Emask 0x4 (timeout)
kernel: ata2.00: status: { DRDY }
kernel: ata2: hard resetting link
kernel: ata2: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
kernel: ata2.00: max_sectors limited to 256 for NCQ
kernel: ata2.00: max_sectors limited to 256 for NCQ
kernel: ata2.00: configured for UDMA/133
kernel: sd 1:0:0:0: timing out command, waited 7s
kernel: ata2: EH complete
kernel: SCSI device sda: 976773168 512-byte hdwr sectors (500108 MB)
kernel: sda: Write Protect is off
kernel: SCSI device sda: drive cache: write back
一整天的負載都高於10-15。
我正在用 atop 監控它,它給出了一些奇怪的讀數:
DSK | sda | busy 100% | read 2 | write 208 | KiB/r 16 | KiB/w 32 | MBr/s 0.00 | MBw/s 0.65 | avq 86.17 | avio 47.6 ms |
DSK | sdb | busy 1% | read 10 | write 117 | KiB/r 17 | KiB/w 5 | MBr/s 0.02 | MBw/s 0.07 | avq 4.86 | avio 1.04 ms |
坦白說,我不明白為什麼只有 sda 受到所有打擊。我確實有一個進程不斷地寫入 1-2megs,但到底是怎麼回事.. 100% iowait?
更新:
smartctl -A /dev/sda
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 239 239 021 Pre-fail Always - 8050
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 22
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 100 100 000 Old_age Always - 595
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 - 21
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 20
193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always - 22
194 Temperature_Celsius 0x0022 118 106 000 Old_age Always - 32
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
答案1
看起來驅動器可能出現故障 - 系統正在重置驅動器/連接嘗試連接它。我猜測,因為您可以看到 sda 和 sdb 的狀態,所以您應該能夠檢查 /proc/mdstat 以了解軟體 raid 可能發生的情況。
IOWait 是因為軟體 raid 正在等待寫入 sda。這反過來又會阻礙進程並導致高負載數。
您應該盡快更換您的 sda。
答案2
對我來說看起來像是一個有問題的磁碟...
答案3
sda 沒有及時處理 I/O 請求。如果不是驅動器問題,則 I/O 不平衡。 sda 上有交換分區嗎?如果是這樣,您可能會遇到記憶體問題,導致記憶體頁面進出交換區時發生顛簸。確保在兩個磁碟機上以相同的優先權分配交換空間。 sar 程序可能會有所幫助。