首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式碼之家 >> 數據庫知識 >  >> Oracle 資料庫 >> Oracle 資料庫基礎

Linux 下 SCSI/IEEE 1394 磁碟 I/O 效能調校實測

     編輯:Oracle 資料庫基礎

調校管道:啟動參數與模組選項

Linux 下 SCSI 子系統效能可透過兩種方式調整:

  1. 開機載入程式 (GRUB/LILO) 核心參數
  2. /etc/modules.conf (或 /etc/modprobe.d/) 模組選項

測試工具:hdparm -Tt /dev/sdX 量測緩衝區讀取與磁碟讀取速度。

實測案例:SBP2 (IEEE 1394/FireWire) 介面

初始狀態檢視

# cat /proc/scsi/sbp2/0
SBP-2 module load options:
- Max outstanding commands supported: 8
- Max outstanding commands per lun supported: 1

基準測試

# hdparm -Tt /dev/sda
Timing buffer-cache reads: 128 MB in 3.99 sec = 32.08 MB/sec
Timing buffered disk reads:  64 MB in 6.86 sec = 9.33 MB/sec

調整模組參數

# /etc/modules.conf
alias scsi_hostadapter sbp2
options sbp2 sbp2_max_outstanding_cmds=16 sbp2_max_cmds_per_lun=2

重啟後驗證參數生效

# cat /proc/scsi/sbp2/0
- Max outstanding commands supported: 16
- Max outstanding commands per lun supported: 2

調校後測試

# hdparm -Tt /dev/sda
Timing buffer-cache reads: 128 MB in 4.03 sec = 35.36 MB/sec
Timing buffered disk reads:  64 MB in 6.04 sec = 11.25 MB/sec

結果分析

  • 磁碟讀取速度從 9.33 → 11.25 MB/sec,**提升 20.6%**
  • 緩衝區讀取微幅提升 (32.08 → 35.36 MB/sec),受 CPU/記憶體影響較大
  • 續增 max_outstanding_cmds 至 255 後發現 16 為效能峰值,更高反而無益
  • 叢集環境下所有節點必須套用相同參數

通用 SCSI 調校參數參考

持久化建議

  • 現代 Linux (systemd) 建議建立 /etc/modprobe.d/scsi_tuning.conf 取代 modules.conf
  • GRUB_CMDLINE_LINUX 加入 scsi_mod.use_blk_mq=1 等核心參數
  • 使用 udev rules 針對特定裝置設定排程器 (deadline/noop/mq-deadline) 與佇列深度

Oracle 資料庫層面的 I/O 優化連結

OS 層面調校為基礎,Oracle 端仍需配合:

  • ASM/檔案系統選擇與 mount 選項 (noatime,nodiratime)
  • 資料檔/重做日誌/暫存表空間分佈於不同物理裝置
  • DB_FILE_MULTIBLOCK_READ_COUNT、DISK_ASYNCH_IO、FILESYSTEMIO_OPTIONS 參數調整
  • 定期 AWR/ASH 分析 log file sync、db file scattered read 等等待事件
  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式碼之家 All Rights Reserved
參數說明建議範圍
max_sectors單次 I/O 最大扇區數256-1024 (視控制器)
cmd_per_lun每 LUN 佇列深度8-32
tagged_command_queueing啟用 TCQ/NCQ1 (啟用)
scsi_mod.use_blk_mq啟用 blk-mq 多佇列 (Kernel 3.13+)Y