Remediation Hub (9)
Purge Stale Remote Media & Old Room History via Admin API
Automated media_retention rules and Admin API history purges keep media_store under 10 GB on modest 50-128 GB VPS disks.
NVMe Freed: 20-80 GB | Endpoint: /_synapse/admin/v1/purge_media_cache
Step 1: Enforce media_retention Inside homeserver.yaml
Add a media_retention block configuring remote_media_lifetime: 14d (or 30d) so Synapse automatically expires cached federated attachments that have not been accessed recently, while preserving your own team uploads.
Step 2: Trigger Immediate Purge via Synapse Admin API
Run POST /_synapse/admin/v1/purge_media_cache?before_ts=<epoch_ms> with an admin bearer token, and optionally purge_history on noisy public rooms where local users no longer need multi-year scrollback.
Measured Thresholds & Configuration
| Retention Directive | Recommended Value | Storage Impact |
|---|---|---|
| remote_media_lifetime | 14d - 30d | Prevents unbounded remote image/video bloat |
| url_preview_enabled | false (on < 100 GB NVMe) | Eliminates link scraper disk & CPU tax |
| purge_history_cron | Public bridged rooms > 90d | Shrinks events & event_json tables |