Rails 如何查看数据库链接被那段程序占用?

jetspeed · June 19, 2020 · Last by hooopo replied at June 19, 2020 · 2208 hits

最近出现了 could not obtain a database connection within 5 seconds 错误,目前连接池配 10 个,puma 两个 worker。如何查看被占用的连接分别是哪些线程,哪段程序?

装个监控直接找慢查询和 http 请求就可以了

You need to Sign in before reply, if you don't have an account, please Sign up first.