Closed
Description
Summary
I've been getting a couple of connection errors in production. I have about 110-120 free connection on the database, but SolidQueue is reporting it couldn't get a connection.
Here's the error in question:
2024-01-29 14:28:07.568 [optonal_prod] worker.1 [SolidQueue] could not obtain a connection from the pool within 5.000 seconds (waited 5.081 seconds); all pooled connections were in use
Here's my config/database.yml
default: &default
adapter: postgresql
encoding: unicode
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
timeout: 5000
development:
<<: *default
database: optonal_development
username: <%= 'postgres' if File.exist?('/.dockerenv') %>
password:
host: <%= 'db' if File.exist?('/.dockerenv') %>
test:
<<: *default
database: optonal_test
username: <%= ENV.fetch('POSTGRES_USER', '') %>
password: <%= ENV.fetch('POSTGRES_PASSWORD', '') %>
host: <%= ENV.fetch('CI', '').empty? ? '' : 'postgres' %>
production:
<<: *default
database: optonal_production
Here's my config/solidqueue.yml
default: &default
dispatchers:
- polling_interval: 1
batch_size: 500
workers:
- queues: [ real_time, background ]
threads: 5
processes: 1
polling_interval: 0.1
development:
<<: *default
test:
<<: *default
production:
<<: *default
Proposal
Document which connection pool SolidQueue uses to connect to the database. Document how many connections does SolidQueue need (e.g. threads * processes).
Metadata
Metadata
Assignees
Labels
No labels