MySQL/Hibernate - How do I debug a MySQL pooled connection that keeps dropping?

后端 未结 3 1759
离开以前
离开以前 2021-02-14 02:51

For months, my web application ran smoothly, but for the past week or two, it keeps dropping its connection to MySQL server. I\'m not a DBA guy and have no idea how to debug thi

3条回答
  •  半阙折子戏
    2021-02-14 03:19

    From the stack-trace you provided, I can draw a single conclusion: you are simply running out of connections.

    This can be caused by long running transactions, possibly due to slow queries or improper application transaction boundaries.

    I suggest you start using FlexyPool, which supports Tomcat DBCP and get a better understanding of both the connection and transaction usage. FlexyPool provides many histograms you might be interested in, like connection acquisition time and lease time.

    An, just to be on the safe side, check the MySQL driver version too and see if you're running on an outdated library.

提交回复
热议问题