鹿野孟城
02/17/2026, 11:46 PMMarvin
02/17/2026, 11:46 PMMarvin
02/17/2026, 11:48 PM# Memory footprint
redis-cli INFO memory | egrep 'used_memory_human|maxmemory_human'
# AOF / RDB status and file sizes
redis-cli INFO persistence | egrep 'aof_enabled|aof_current_size|rdb_last_bgsave_status'
# Stream sizes (adjust stream key if used)
redis-cli XLEN prefect:events
redis-cli XLEN prefect:messages
# Consumer lag (replace keys/group as appropriate)
redis-cli XINFO GROUPS prefect:events
Happy to tune these numbers if you can share:
- Rough concurrent flow runs and runs/hour
- Whether AOF is enabled
- Any observed Redis used_memory and aof_current_size during peak hours
- Whether Redis is shared between background service coordination and messaging or split into separate instances/databases鹿野孟城
02/18/2026, 12:02 AMMarvin
02/18/2026, 12:02 AMMarvin
02/18/2026, 12:05 AMappendonly yes
appendfsync everysec
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
aof-use-rdb-preamble yes
# Optional RDB snapshots (tune to your RPO)
save 900 1
save 300 10
save 60 10000
rdbcompression yes
Operational tips for Prefect
- Separate concerns: use different Redis databases or instances for background-service coordination (Docket) vs. messaging to limit blast radius and tune persistence independently.
- Keep message streams trimmed aggressively to cap memory and AOF growth.
- Monitor and adjust:
- Memory: used_memory
- AOF size and rewrite stats
- Stream lengths (XLEN) and consumer lag
- If you disable persistence, plan for brief lag after restarts while services rescan the database and rebuild state.
Relevant docs
- How to scale self-hosted Prefect (Redis for messaging and background services)
- Run Prefect Server via Docker Compose (example with Redis and volumes)
- Background tasks and services
- Settings reference (messaging and Docket URL settings)
- Redis persistence overview: Redis persistence (RDB vs AOF)
If you can share your RPO/RTO targets, event volume, and whether this Redis is shared or dedicated, I can recommend a concrete mode and config.