mysql關於最大連線數、最大併發執行緒數的區別

lusklusklusk發表於2019-02-21

show variables like 'max_connections'

max_connections:支援的最大併發連線數

The maximum permitted number of simultaneous client connections


show variables like 'innodb_thread_concurrency'

innodb_thread_concurrency:支援的最大併發執行的執行緒數

InnoDB tries to keep the number of operating system threads concurrently inside InnoDB less than or equal to the limit given by this variable (InnoDB uses operating system threads to process user transactions). Once the number of threads reaches this limit, additional threads are placed into a wait state within a “First In, First Out” (FIFO) queue for execution. Threads waiting for locks are not counted in the number of concurrently executing threads.

thread_concurrency:支援的最大併發執行的執行緒數

這個變數特定於Solaris 8和更早的系統,允許應用程式向執行緒系統提示應該同時執行的執行緒數量。MySQL 5.7.2中刪除了這個變數。

This variable is specific to Solaris 8 and earlier systems, for which mysqld invokes the thr_setconcurrency() function with the variable value. This function enables applications to give the threads system a hint about the desired number of threads that should be run at the same time. Current Solaris versions document this as having no effect.This variable was removed in MySQL 5.7.2.



檢視伺服器的連線次數

show status like 'Connections';

檢視曾經的最大連線數

show status like 'Max_used_connections';

檢視當前連線的執行緒數

show status like 'Threads_connected';

檢視當前正在執行的執行緒數

show status like 'threads_running';

檢視執行緒快取中的執行緒數

show status like 'threads_cached';

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30126024/viewspace-2636632/,如需轉載,請註明出處,否則將追究法律責任。

相關文章