地方エンジニアの学習日記

興味ある技術の雑なメモだったりを書いてくブログ。たまに日記とガジェット紹介。

MySQLの"Connections"とか"Max_used_connections"とか"Threads_connected"とか

理解できていなかったのでまとめ。

connection数ってConnectionsだけ見てれば良いかなと思っていたが監視システムによっては1分毎の監視とかになってしまって0.1sで終わるクエリが同時に1000でmax_connectionsが151とかになっている場合にConnectionsのグラフには現れないよねという話。どうすれば良いかを考えた結果Connection_errors_max_connectionsを監視しておけばよさそうと思った。これがあればある程度振り返りはできそうで便利。

ちなみにMackerelのmysqlプラグインでは今の所取れないのでどうしようか悩み中

github.com

Connections
The number of connection attempts (successful or not) to the MySQL server.
MySQL Server への (成功またはそれ以外の) 接続の試行数。

Max_used_connections
The maximum number of connections that have been in use simultaneously since the server started.
サーバーが開始されてから同時に使用された接続の最大数

Connection_errors_max_connections
The number of connections refused because the server max_connections limit was reached.
サーバーの max_connections 制限に到達したため拒否された接続の数。