Redirect & DB Tuning
Preventing Shlink RoadRunner Worker Memory Creep With max_jobs
Cap long-lived RoadRunner PHP worker RSS growth during sustained multi-million-click campaigns using deterministic max_jobs recycling.
max_jobs=10000 · ~62 MB Steady RSS · Zero Dropped 302s
Why Persistent Workers Slowly Accumulate RSS
Because RoadRunner keeps PHP processes alive across thousands of requests, ORM identity maps, logging buffers, and MMDB caches gradually fragment heap memory over weeks of continuous traffic.
Graceful Zero-Downtime Worker Recycling
Setting max_jobs: 10000 and max_worker_memory: 256 instructs RoadRunner to drain and respawn one worker at a time after 10,000 redirects, keeping cluster RAM flat without dropping a single client request.
Measured Thresholds & Shortener Stack Parameters
| RoadRunner Setting | Unbounded Default | Production Recommended |
|---|---|---|
| pool.max_jobs | 0 (never restart worker) | 10000 (graceful recycle) |
| pool.supervisor.max_worker_memory | Disabled | 256 MB hard ceiling |
| Steady-State Worker RSS | Creeps to 400+ MB over days | Holds flat at 62-95 MB |