Hello everyone,
I’m experiencing a performance issue with Zammad 7.0.1 and I would appreciate any guidance.
Environment
- Zammad: 7.0.1-1775747706.81b38d6a.bookworm
- Installation: Official Debian package (not Docker)
- OS: Debian 12
- PostgreSQL: External server (PostgreSQL 17.6)
- Elasticsearch: Local
- Redis: Local
Server resources:
- 8 vCPU
- 16 GB RAM
- Elasticsearch heap around 4 GB
Problem
Incoming emails are received immediately by the mail server, but they are converted into Zammad tickets with a delay of approximately one hour.
The delay becomes worse as the system receives more emails during the day.
What we found
Delayed jobs continuously increase instead of decreasing.
Examples:
633
812
866
1064
Running:
zammad run rails r “puts Delayed::Job.group(:queue).count”
returns approximately:
{
“default” => 789,
“communication_inbound” => 23
}
The jobs are mostly:
- SearchIndexJob
- SearchIndexAssociationsJob
- TransactionJob
- TaskbarUpdateRelatedTasksJob
- TaskbarUpdateTriggerSubscriptionsJob
- TicketUserTicketCounterJob
There are no failed delayed jobs.
failed_at count = 0
Worker
Only one worker is running:
zammad-worker-1.service
The worker had previously restarted hundreds of times.
The logs contain:
ActiveRecord::ConnectionTimeoutError:
could not obtain a connection from the pool within 5.000 seconds;
all pooled connections were in use
Database
database.yml
pool: 50
Rails confirms:
ActiveRecord::Base.connection_pool.stat
returns
size: 50
connections: 0
busy: 0
dead: 0
idle: 0
waiting: 0
The connection test succeeds:
ActiveRecord::Base.connection.execute(“SELECT version()”)
works correctly.
Also:
10x SELECT pg_sleep(1)
runs successfully.
PostgreSQL server is not saturated.
max_connections = 200
Very few active connections.
Server utilization
CPU usage is low:
~92% idle
Memory is fine:
16 GB RAM
No swap pressure
Redis is healthy.
Elasticsearch is running correctly.
Question
Has anyone seen Delayed::Job continuously growing on Zammad 7.0.1 together with ActiveRecord::ConnectionTimeoutError?
Is this a known issue with Background Services or should we investigate a specific worker configuration?
Any advice would be greatly appreciated.
Thank you.
Additional information:
The PostgreSQL server is hosted on a separate machine.
Increasing the application server RAM from 8 GB to 16 GB did not solve the problem.
The infrastructure is healthy, but Delayed::Job continues to grow over time.