mysql檢視連線數 最多併發數

2021-08-31 16:41:08 字數 647 閱讀 6717

顯示狀態,如'%max_connections%';

## mysql的最大連線數

set global max_connections = 1000 ##重新設定

顯示'%max_connections%'等變數;

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

顯示全球狀態,如'max_used_connections';

##伺服器響應的最大連線數

顯示'threads%'的狀態;

variable_name值

threads_cached 0 ## mysql管理的執行緒池中還有多少可以被復用的資源

threads_connected 152 ##開啟的連線數

threads_created 550 ##表示建立過的執行緒數,如果發現threads_created值過大的話,表明mysql伺服器一直在建立執行緒,這也是比較耗資源,可以適當增加配置檔案中thread_cache_size值,查詢伺服器

threads_running 1 ##啟用的連線數,這個數值一般遠低於connected數值,準確的來說,threads_running是代表當前併發數

顯示'thread_cache_size'等變數;

set global thread_cache_size = 60;

檢視併發連線數

netstat n awk tcp end 返回結果示例 last ack 5 syn recv 30 established 1597 fin wait1 51 fin wait2 504 time wait 1057 其中的syn recv表示正在等待處理的請求數 established表示正常...

Mysql 檢視連線數,狀態 最大併發數

show status like max connections mysql最大連線數 set global max connections 1000 重新設定 show variables like max connections 查詢資料庫當前設定的最大連線數 show global statu...

Mysql 檢視連線數,狀態 最大併發數

show status like max connections mysql最大連線數 set global max connections 1000 重新設定 show variables like max connections 查詢資料庫當前設定的最大連線數 show global statu...