簡體   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