Remediation Hub (9)
Set Synapse caches.global_factor to 0.5 and Tune per_cache_factors
Lowering caches.global_factor from 1.0 to 0.5 (or 0.25 on 2 GB hosts) slashes Synapse Python heap usage by 35-50% with minimal cache miss penalty.
RAM Saved: 35-50% Python Heap | Directive: caches.global_factor: 0.5
Step 1: Override Default Cache Sizing in homeserver.yaml
By default Synapse sets global_factor: 1.0, sizing dozens of internal dictionaries (get_users_in_room, _get_state_group_from_group, event_cache) for large servers. Adding caches: global_factor: 0.5 and expiry_time: 15m forces prompt eviction of cold room state.
Step 2: Trim Specific High-Churn Caches via per_cache_factors
If Prometheus shows synapse_util_caches_descriptors_cache_size still climbing, selectively set event_cache_size: 2K and per_cache_factors: { get_current_state_ids: 0.35 } while keeping auth caches warm.
Measured Thresholds & Configuration
| VPS RAM Tier | caches.global_factor | Expected Synapse Steady RSS |
|---|---|---|
| 2 GB RAM Emergency | 0.25 + expiry_time: 10m | 650 - 950 MB |
| 4 GB RAM Standard | 0.50 + expiry_time: 20m | 1.1 - 1.7 GB |
| 8 GB+ RAM Worker Pool | 0.80 - 1.00 | 2.2 - 3.8 GB |