Config Fixes // TraceLite Bench
PostgreSQL shared_buffers, work_mem & 14–90 Day Retention
Sizing shared_buffers to 20-25% of host RAM and enforcing GLITCHTIP_MAX_EVENT_LIFE_DAYS keeps PostgreSQL fast on 2-8 GB NVMe VPS.
Measured GlitchTip & Sentry Telemetry
PostgreSQL thrives on NVMe IOPS and Linux filesystem page cache rather than oversized shared_buffers inside Docker. Keeping shared_buffers compact lets the OS kernel cache hot B-tree indexes while protecting Celery workers from OOM.
| Subsystem / Signal | Measured Footprint | Operational Impact |
|---|---|---|
| 2 GB Node Postgres Flags | shared_buffers=384MB | work_mem=4MB, max_connections=80 |
| 4 GB Node Postgres Flags | shared_buffers=768MB | work_mem=8MB, max_connections=100 |
| 8 GB Node Postgres Flags | shared_buffers=1536MB | work_mem=16MB, max_connections=150 |
Step-by-Step Triage & Compose Remediation
- Pin shared_buffers and work_mem: Pass explicit -c flags in the postgres command array in docker-compose.yml.
- Set 14-90 day retention: Configure GLITCHTIP_MAX_EVENT_LIFE_DAYS=30 and GLITCHTIP_MAX_FILE_LIFE_DAYS=30 in .env.
- Verify Beat cleanup logs: Confirm cleanup_old_events runs nightly in worker logs.
command: - "postgres" - "-c" - "shared_buffers=768MB" - "-c" - "work_mem=8MB" - "-c" - "effective_cache_size=2048MB"
Diagnostic FAQ
What retention window fits a 50 GB NVMe Hostinger KVM 1 node?
Up to 1.5M monthly events at 30 days retention fits easily inside 50 GB NVMe with room for OS and logs.
Is external managed Postgres required?
No. Local NVMe Postgres inside Docker Compose delivers lower latency and saves $15-$30/mo.