https://book.2cto.com/201402/40300.htmlhtml
在MySQL5.1.X版本中,innodb_file_io_threads參數默認是4,該參數在Linux系統上是不可更改的,但Windows系統上能夠調整。這個參數的做用是:InnoDB使用後臺線程處理數據頁上讀寫I/O(輸入輸出)請求的數量。linux
在MySQL5.5.X版本中,或者說是在InnoDB Plugin1.0.4之後,就用兩個新的參數,即innodb_read_io_threads和innodb_write_io_threads,取代了innodb_file_io_threads如此調整後,在Linux平臺上就能夠根據CPU核數來更改相應的參數值了,默認是4。數據庫
假如CPU是2顆8核的,那麼能夠設置:
innodb_read_io_threads = 8
innodb_write_io_threads = 8線程
若是數據庫的讀操做比寫操做多,那麼能夠設置:
innodb_read_io_threads = 10
innodb_write_io_threads = 6htm
也就是說,你能夠根據狀況加以設置。get
注意requests
這兩個參數不支持動態改變,須要把該參數加入my.cnf裏,修改完後重啓MySQL服務,容許值的範圍是1~64。it
調整完成後,你能夠用命令「show engine innodb status\G;」來查看調整結果,以下所示:
show engine innodb status
--------
FILE I/O
--------
I/O thread 0 state: waiting for completed aio requests (insert buffer thread)
I/O thread 1 state: waiting for completed aio requests (log thread)
I/O thread 2 state: waiting for completed aio requests (read thread)
I/O thread 3 state: waiting for completed aio requests (read thread)
I/O thread 4 state: waiting for completed aio requests (read thread)
I/O thread 5 state: waiting for completed aio requests (read thread)
I/O thread 6 state: waiting for completed aio requests (write thread)
I/O thread 7 state: waiting for completed aio requests (write thread)
I/O thread 8 state: waiting for completed aio requests (write thread)
I/O thread 9 state: waiting for completed aio requests (write thread)io
關於innodb_read_io_threads和innodb_write_io_threads參數的含義,請參見MySQL5.5 手冊:
innodb