Backpressure
debt(d8/e7/b7/t7)
Closest to 'silent in production until users hit it' (d9), slightly better at d8 because detection_hints.automated is no and the rpush/queue.push pattern is suggestive but not conclusive — missing backpressure typically only manifests under production load spikes via OOM.
Closest to 'cross-cutting refactor across the codebase' (e7), because the quick_fix involves bounding queues, adding 503 responses to producers, monitoring, and consumer scaling — these touch producer, consumer, and infrastructure layers.
Closest to 'strong gravitational pull' (b7), because applies_to spans web, cli, and queue-worker contexts, and flow-control decisions shape how every producer/consumer pair is written across the system.
Closest to 'serious trap' (t7), because the misconception explicitly states devs believe unlimited queues are safer — the intuitive 'don't drop work' instinct is exactly backwards from the correct 'bounded + reject' design.
TL;DR
Explanation
Without backpressure: fast producer + slow consumer → queue grows indefinitely → OOM or unbounded latency. Backpressure strategies: (1) Block producer (synchronous — producer waits until consumer is ready). (2) Drop messages (circuit breaker — shed load). (3) Buffer with size limit (bounded queue — producer blocks or errors when full). (4) Rate limiting producer. (5) Signal via protocol (TCP flow control, Reactive Streams, gRPC flow control). In PHP: Redis list maxlength, queue bounded size, Swoole channel with capacity, HTTP 429 Too Many Requests. ReactiveX / RxPHP: Observable with backpressure operators.
Common Misconception
Why It Matters
Common Mistakes
- Infinite queue — hides the problem until OOM.
- No backpressure to HTTP clients — API accepts more than it can process.
- Blocking the event loop with backpressure — use async/non-blocking where possible.
Code Examples
// Unbounded Redis list — can grow until OOM:
$redis->rpush('jobs', $job); // No limit
// Bounded with backpressure:
$len = $redis->llen('jobs');
if ($len >= 10000) {
throw new ServiceUnavailableException('Queue full — apply backpressure');
// HTTP 503 to caller — let them retry
}
$redis->rpush('jobs', $job);