如何查看當前Innodb的併發

如何查看當前Innodb的併發線程數?

在MySQL中:

  • Threads_connected表示當前數據庫server層的鏈接數,對應參數max_connections;

  • 使用Threads_running表示已經連接的線程中,正在執行SQL的線程併發數

  • 我們還知道在Innodb中還存在一個併發數的限制,可以參照參數innodb_thread_concurrency,它限制了進入Innodb執行某些操作的併發線程數。但是並沒有對應的狀態值status show global status 來表示當前有多少個線程進入了Innodb。

這個信息其實隱藏在了show engine innodb status的結果中,見如下

--------------
ROW OPERATIONS
--------------
0 queries inside InnoDB, 0 queries in queue
0 read views open inside InnoDB
Process ID=3829, Main thread ID=140003619354368, state: sleeping
Number of rows inserted 1146913, updated 524289, deleted 1, read 6832252
0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s

其中0 queries inside InnoDB就是當前進入innodb的併發
0 queries in queue表示等待隊列FIFO中的線程中。

關於Innodb完整的併發控制策略,見
https://dev.mysql.com/doc/refman/5.7/en/innodb-performance-thread_concurrency.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章