DBへの接続数を調査した際のまとめです。
数値は凡例です。
最大接続数設定
コマンド
mysql > show global variables like 'max_connections';
結果
Variable_name |
Value |
max_connections |
66 |
DBが起動してからこれまでの累積接続数
コマンド
mysql > show global status like 'Connections';
結果
Variable_name |
Value |
Connections |
569611 |
DBが起動してからこれまでの最大同時接続数
コマンド
mysql > show global status like 'Max_used_connections';
結果
Variable_name |
Value |
Max_used_connections |
14 |
Threads 関連ステータス
コマンド
mysql > show global status like 'Thread_%';
結果
Variable_name |
Value |
意味 |
Threads_cached |
6 |
キャッシュされたスレッド数 |
Threads_connected |
3 |
現在の接続数 |
Threads_created |
503 |
生成されたスレッド数 |
Threads_running |
1 |
実行中のスレッド数 |
起動中のプロセス
コマンド
mysql > show full processlist;
結果
Id |
User |
Host |
db |
Command |
Time |
State |
Info |
42916 |
rdsadmin |
localhost:29736 |
mysql |
Sleep |
1 |
|
NULL |
569581 |
uralogical |
hogefuga.tokyff01.ap.so-net.ne.jp:xxxxx |
uralogicaldb |
Query |
0 |
starting |
show full processlist |
569582 |
uralogical |
hogefuga.tokyff01.ap.so-net.ne.jp:xxxxx |
NULL |
Sleep |
11 |
|
NULL |
プロセスの終了
コマンド
mysql > KILL processlist_id;