Monitoring used connections on mysql to debug 'too many connections'

后端 未结 4 782
囚心锁ツ
囚心锁ツ 2020-12-31 03:07

On LAMP production server I get the \'too many connections\' error from MYSQL occasionally, I want to add monitoring to find if the reason is that I exceed the max-connectio

4条回答
  •  清酒与你
    2020-12-31 03:30

    SHOW STATUS doesn't display total connections: it displays current connections. You get the too many connections error message when the number of open connections (idle or not) surpases the limit established for the server.

    From your comment about SHOW STATUS, I looks like you have many idle connections in your server. That points to misuse of persistent connections; some libraries that claim to support persistent connections do not handle them properly and they tend to open new connections even when there're idle connections available.

    Find out what application is running such queries and configure it not to use persistent connections.

提交回复
热议问题