檢視mysql資料庫連線數 併發數相關資訊

2021-08-27 22:35:07 字數 819 閱讀 4788

mysql> show status like 'threads%';

+-------------------+-------+

| variable_name     | value |

+-------------------+-------+

| threads_cached    | 58    |

| threads_connected | 57    |   ###這個數值指的是開啟的連線數

| threads_created   | 3676  |

| threads_running   | 4     |   ###這個數值指的是啟用的連線數,這個數值一般遠低於connected數值

+-------------------+-------+

threads_connected 跟show processlist結果相同,表示當前連線數。準確的來說,threads_running是代表當前併發數

這是是查詢資料庫當前設定的最大連線數

mysql> show variables like '%max_connections%';

+-----------------+-------+

| variable_name   | value |

+-----------------+-------+

| max_connections | 1000  |

+-----------------+-------+

可以在/etc/my.cnf裡面設定資料庫的最大連線數

[mysqld]

max_connections = 1000

檢視mysql資料庫連線數 併發數相關資訊

檢視mysql資料庫連線數 併發數相關資訊 2011 11 18 14 24 00 分類 linux mysql show status like threads variable name value threads cached 58 threads connected 57 這個數值指的是開啟...

檢視mysql資料庫連線數 併發數相關資訊

mysql show status like threads variable name value threads cached 58 threads connected 57 這個數值指的是開啟的連線數 threads created 3676 threads running 4 這個數值指的是...

檢視mysql資料庫連線數 併發數相關資訊

1 檢視連線數 show status like threads variable name value threads cached 58 threads connected 57 這個數值指的是開啟的連線數 threads created 3676 threads running 4 這個數值指...