Error Diagnostics // TraceLite Bench
PostgreSQL Partition & Autovacuum Memory Bloat
Retaining 60-90 days of raw JSONB event payloads without automated partition cleanup causes PostgreSQL disk bloat, slow issue search, and autovacuum RAM spikes.
Measured GlitchTip & Sentry Telemetry
GlitchTip stores event payloads and issue aggregates inside PostgreSQL. When GLITCHTIP_MAX_EVENT_LIFE_DAYS is left at excessive defaults or Celery Beat stops executing cleanup tasks, dead tuples accumulate and force expensive sequential scans and vacuum passes.
| Subsystem / Signal | Measured Footprint | Operational Impact |
|---|---|---|
| 2.5M events @ 30d retention | 14 - 22 GB NVMe | 650 - 950 MB Postgres RSS |
| 15M events @ 90d retention | 75 - 125 GB NVMe | 1.6 - 2.3 GB Postgres RSS |
| Healthy shared_buffers Ratio | 20 - 25% Host RAM | Leaves headroom for Celery & OS cache |
Step-by-Step Triage & Compose Remediation
- Check largest Postgres tables: Query pg_total_relation_size on events_event and issue tables to spot unpruned partitions.
- Enforce retention env vars: Set GLITCHTIP_MAX_EVENT_LIFE_DAYS=30 (or 14-90) and verify Celery Beat is running.
- Size shared_buffers accurately: Pass -c shared_buffers=512MB (on 2-4 GB VPS) or 1536MB (on 8 GB VPS) in docker-compose.yml.
SELECT relname, pg_size_pretty(pg_total_relation_size(relid)) FROM pg_catalog.pg_statio_user_tables ORDER BY pg_total_relation_size(relid) DESC LIMIT 8;
Diagnostic FAQ
Does GlitchTip auto-delete old events?
Yes, provided run-celery-with-beat.sh is running and GLITCHTIP_MAX_EVENT_LIFE_DAYS is configured.
Why not give Postgres 50% RAM on a 4 GB node?
Celery workers, Django Gunicorn, Redis, and OS page cache share that 4 GB; >25% shared_buffers causes OOM.