Hi maintainers, thanks for this gem.
We are using solid_queue_monitor 1.1.0 with PostgreSQL and hit severe performance issues at production scale.
Environment
solid_queue_monitor: 1.1.0
solid_queue: 1.3.x
- PostgreSQL
solid_queue_jobs row count: ~4,014,921
Observed behavior
The monitor root page (/solid_queue) becomes effectively unusable (gateway timeout in production).
A direct DB check:
SELECT count(1) FROM solid_queue_jobs;
Takes about 52,356 ms in our production.
The overview page triggers multiple expensive queries in one request:
COUNT(*) on solid_queue_jobs
COUNT(*) WHERE finished_at IS NOT NULL on solid_queue_jobs
- additional counts on execution tables
- chart aggregation queries over time windows
From app logs, this all happens in the same overview request.
Why this hurts
On large datasets, these operations are too heavy for interactive UI endpoints and can exceed upstream timeout thresholds.
Additional pressure points
- Queue page (
/queues) executes multiple per-queue counter queries (N+1 style across queues).
- Some pages default to sorting by
created_at on execution tables. On large tables this requires dedicated indexes and still does not solve count-heavy page design.
Proposed improvements
It would be great to have built-in "large dataset mode" or similar options:
- Lightweight overview mode
- Skip exact
solid_queue_jobs.count and completed exact count by default.
- Optionally use approximate row estimates (e.g. PostgreSQL reltuples).
- Disable or defer chart data on initial page load
- Lazy-load chart only when requested by user.
- Optional toggle to disable chart entirely.
- Avoid expensive total counts for pagination on hot pages
- Support keyset/cursor pagination or optional "no total pages" mode.
- Optimize queues index page aggregation
- Replace per-queue repeated counts with grouped aggregation queries.
- Safe default root page option
- Optional configuration to land on a lightweight page (
/workers or /ready_jobs) instead of overview.
Reference areas in current gem
overview_controller#index (stats + chart + recent jobs in one request)
stats_calculator
chart_data_service
queues_controller#index
- ready/in-progress pages default ordering and pagination behavior
If helpful, I can provide anonymized EXPLAIN ANALYZE outputs for the top slow queries.
Hi maintainers, thanks for this gem.
We are using
solid_queue_monitor 1.1.0with PostgreSQL and hit severe performance issues at production scale.Environment
solid_queue_monitor: 1.1.0solid_queue: 1.3.xsolid_queue_jobsrow count: ~4,014,921Observed behavior
The monitor root page (
/solid_queue) becomes effectively unusable (gateway timeout in production).A direct DB check:
Takes about 52,356 ms in our production.
The overview page triggers multiple expensive queries in one request:
COUNT(*)onsolid_queue_jobsCOUNT(*) WHERE finished_at IS NOT NULLonsolid_queue_jobsFrom app logs, this all happens in the same overview request.
Why this hurts
On large datasets, these operations are too heavy for interactive UI endpoints and can exceed upstream timeout thresholds.
Additional pressure points
/queues) executes multiple per-queue counter queries (N+1 style across queues).created_aton execution tables. On large tables this requires dedicated indexes and still does not solve count-heavy page design.Proposed improvements
It would be great to have built-in "large dataset mode" or similar options:
solid_queue_jobs.countandcompletedexact count by default./workersor/ready_jobs) instead of overview.Reference areas in current gem
overview_controller#index(stats + chart + recent jobs in one request)stats_calculatorchart_data_servicequeues_controller#indexIf helpful, I can provide anonymized EXPLAIN ANALYZE outputs for the top slow queries.