Contents
I/O tuning in Oracle: filesystemio_options and disk_asynch_io
第一部分:這是系列I / O調整的第一部分
UNIX和Linux系統中的I / O操作通常通過文件系統緩存進行。儘管這本身並不代表問題,但是這種額外的處理確實需要資源。繞過文件系統緩存可減少CPU需求,並釋放文件系統緩存以進行其他非數據庫文件操作。針對原始設備的操作會自動繞過文件系統緩存。
當將同步I / O請求提交給操作系統時,寫入過程將阻塞,直到寫入完成,然後再繼續進行處理。使用異步I / O,將在提交和處理I / O請求的同時繼續處理。這允許異步I / O繞過與I / O操作相關的某些性能瓶頸。
檢查服務器是否有直接I / O
- 操作系統的配置方法將根據所使用的操作系統和文件系統而有所不同。以下是一些快速檢查的示例,任何人都可以執行這些檢查來確保您使用的是直接I / O:Solaris-查找“ forcedirectio”和filesystemio_options = setall選項。 Oracle DBA聲稱,此選項對Sun服務器的I / O速度有巨大的影響。另請注意此Oracle上的Sun Solaris文檔:“避免使用緩衝的VxFS或高速緩存的QIO”。這是Sun文檔。此外,Glen Faucett還指出了使用filesystemio_options = setall和forcedirectio在Sun Solaris Oracle服務器上設置直接I / O的技巧。另請參見Solaris上DirectIO所需的10g補丁。
- AIX-高DML數據庫可能要使用直接I / O(DIO而不是JFS或CIO。請參閱有關將Oracle AIX與直接I / O結合使用的說明,這些說明是通過AIX“ dio”選項和init.ora參數實現的filesystemio_options: Oracle init.ora:filesystemio_options = SETALL
- JFS2掛載選項:掛載?o dio /oradata/ts1.dbf
- Veritas VxFS-(包括HP-UX,Solaris和AIX),查找“ convosync = direct”。還可以使用Veritas QIO在每個文件的基礎上啟用直接I / O。請參閱“ qiostat”命令和相應的手冊頁以獲取提示。對於HPUX,請參閱HP-UX上的Oracle?最佳做法。
- Linux-Linux系統支持基於每個文件句柄的直接I / O(這要靈活得多)。同樣在10g及更高版本中,此功能已經可以使用,這意味著不需要任何補丁。對於Oracle,DBA將需要下載-摘要:NFS上的直接IO支持。要啟用直接I / O支持:,請檢查以下設置: -將參數文件中的filesystemio_options參數設置為DIRECTIO(filesystemio_options = DIRECTIO) -如果正在使用異步I / O選項,則應將參數文件中的filesystemio_options參數設置為SETALL。
- If you are Oraclerelease2, you can track I/O for specific Oracle tables and indexes. This allows you to see the specific sources of physical I/O.
Oracle can take advantage of direct I/O and asynchronous I/O on supported platforms using the FILESYSTEMIO_OPTIONS parameter, whose possible values are listed below.
ASYNCH - Enabled asynchronous I/O where possible.
DIRECTIO- Enabled direct I/O where possible.
SETALL- Enabled both direct I/O and asynchronous I/O where possible.
NONE - Disabled both direct I/O and asynchronous I/O.大多數性能調整問題都可能與任何數據庫中的I / O有關。 Oracle僅提供兩個主要參數來控制I / O行為,它們是filesystemio_options和disk_asynch_io
filesystemio_options允許您指定同步和異步讀/寫以及直接和間接讀寫。默認情況下為空,這表示已選擇操作系統默認的I / O模式,即同步讀/寫和間接讀寫,即文件系統緩存的讀寫操作。但是由於disk_asynch_io參數默認為true,因此Oracle默認情況下支持異步讀寫。
Oracle recommends to set parameter filesystemio_options to value 'setall' but it is not always good practise especially when SGA is small. setting it to setall lets your Oracle DB perform I/O operations without going to file system cache and it saves overhead of double caching but if SGA is smaller and DB host machine has large free memory then it is not good to set this parameter to value setall. In this case you should increase DB_CACHE_SIZE and only then set filesystemio_options to setall.
