繁体   English   中英

postgresql中的数据库连接超时错误

[英]Database connection timeout error in postgresql

目前正在使用sidekiq运行backgroud作业,同时运行它的“ActiveRecord :: ConnectionTimeoutError”。

This is my current database.yml file,

production:
  adapter: postgresql
  encoding: unicode
  database: app_production
  username: password
  password:
  host: app.domain.com
  pool: 25

这是我的sidekiq.yml文件,

production:
    concurrency: 25
    timeout: 300

在运行其给定连接超时错误时

这个错误是在背景中,

could not obtain a database connection within 5 seconds (waited 5.82230675 seconds). The max pool size is currently 25; consider increasing it.

您的postgres数据库允许的最大连接数为25.但是您已将sidekiq的并发设置为25.因此,如果您运行sidekiq的所有并发线程,则您的应用服务器将无法使用任何数据库连接。

减少sidekiq并发性或增加池大小(我建议增加池大小)。

Postgres默认允许100个并发连接

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM