Mysql數據庫 查看連接數,狀態 最大並發數設置


show status like '%max_connections%'; ##mysql最大連接數
set global max_connections=1000 ##重新設置
show variables like '%max_connections%'; ##查詢數據庫當前設置的最大連接數

show global status like 'Max_used_connections'; ##服務器響應的最大連接數

show status like 'Threads%';

Variable_name Value
Threads_cached 0 ##mysql管理的線程池中還有多少可以被復用的資源
Threads_connected 152 ##打開的連接數
Threads_created 550 ##表示創建過的線程數,如果發現Threads_created值過大的話,表明MySQL服務器一直在創建線程,這也是比較耗資源,可以適當增加配置文件中thread_cache_size值,查詢服務器
Threads_running 1 ##激活的連接數,這個數值一般遠低於connected數值,准確的來說,Threads_running是代表當前並發數

show variables like 'thread_cache_size';
set global thread_cache_size=60;


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM