purge_adaptive_capacity
Purge processes its queue in fixed-size chunks per cron run (often 100 items), set by the active purger. When cache invalidations are produced faster than they are processed — or when cron is delayed — the queue grows and never catches up.
Purge Adaptive Capacity scales the number of items processed per cron run based on the current queue size: more items when the backlog grows toward a configurable high-watermark, fewer when it shrinks (never below a configurable minimum). This keeps the queue under control without permanently over-processing.
Features
- Scales the per-cron processing limit linearly with the queue size.
- Configurable minimum (hard floor of 100), maximum, and queue high-watermark.
- Purger-agnostic: decorates Purge's capacity tracker, so it works with any purger.
- Respects Purge's execution-time safeguards — the limit acts as an upper bound.
- Can be disabled to fall back to the standard purger capacity.
Post-Installation
After enabling the module, go to Administration » Configuration » Development » Purge adaptive capacity (/admin/config/development/performance/purge-adaptive-capacity) and set the minimum items, maximum items, and queue high-watermark. The scaling formula is: limit = min_items + (max_items - min_items) * min(1, queue_size / queue_high_watermark).
Additional Requirements
Requires the Purge module.
Similar projects
Unlike static configuration of a purger's capacity, this module adjusts the limit dynamically at runtime based on the live queue size.