towerops/config
Graham McIntire 68354af021 fix: prevent Oban index bloat by reindexing primary key and scheduling index (#165)
Severe index bloat discovered on oban_jobs:
- oban_jobs_pkey: 82.2 bloat ratio, 3.2GB waste
- oban_jobs_state_queue_priority_scheduled_at_id_index: 216.8 bloat, 7.9GB waste

Root cause: High DELETE churn from aggressive Pruner config (10k jobs/sec)
causes PostgreSQL VACUUM to leave dead index entries. VACUUM only marks space
as reusable but cannot shrink indexes.

The Oban Reindexer plugin was only reindexing args_index and meta_index by
default, missing the primary key and main scheduling index.

Solution: Explicitly configure Reindexer to include all high-churn indexes:
- oban_jobs_pkey (primary key, used by all queries)
- oban_jobs_state_queue_priority_scheduled_at_id_index (job scheduling)
- oban_jobs_args_index (default, GIN index)
- oban_jobs_meta_index (default, GIN index)

Daily REINDEX CONCURRENTLY at 2 AM will prevent future bloat accumulation.

Manual immediate reindex required to reclaim 11GB:
  REINDEX INDEX CONCURRENTLY oban_jobs_pkey;
  REINDEX INDEX CONCURRENTLY oban_jobs_state_queue_priority_scheduled_at_id_index;

Reviewed-on: graham/towerops-web#165
2026-03-25 12:36:10 -05:00
..
config.exs fix SSL CA trust store for HTTPS in containers 2026-03-11 14:48:54 -05:00
dev.exs fix: remove Redis config from dev.exs to allow CI health checks to pass 2026-03-08 10:05:12 -05:00
prod.exs fix: suppress noisy health check logs in production 2026-03-05 13:13:19 -06:00
runtime.exs fix: prevent Oban index bloat by reindexing primary key and scheduling index (#165) 2026-03-25 12:36:10 -05:00
test.exs fix: add recurring job dispatch timer for agent-polled devices 2026-03-12 12:07:34 -05:00