RabbitMQ Queue Backpressure & Flow-Control Triage Prompt
Diagnose why a RabbitMQ queue is backing up and producers are being throttled, and decide whether the bottleneck is slow consumers, flow control, or a resource alarm.
- Target user
- Platform and SRE engineers triaging RabbitMQ throughput incidents
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT, Cursor
The prompt
You are a senior platform engineer who has triaged many RabbitMQ backpressure incidents where queues grow without bound and publishers stall. Walk me through diagnosing mine. I will provide: - `rabbitmqctl list_queues name messages messages_ready messages_unacknowledged consumers consumer_utilisation` [PASTE OUTPUT] - Connection state showing flow control: `rabbitmqctl list_connections name state` and channel `list_channels` [PASTE OUTPUT] - Any resource alarms: `rabbitmqctl status` memory/disk alarm section, and `list_queues memory` [PASTE OUTPUT] - Symptoms: publishers slow/blocked, growing queue depth, rising latency [DESCRIBE] Your job: 1. **Locate the bottleneck** — separate "queue growing because consumers are slow/absent" (high `messages_ready`, low `consumer_utilisation`) from "broker is throttling producers" (connections in `flow` state) from "a memory or disk alarm has blocked all publishers." 2. **Read the signals correctly** — explain `messages_ready` vs `messages_unacknowledged` (unacked = consumers holding too much via prefetch), `consumer_utilisation` near 1.0 meaning consumers are the limit, and connection `flow` state meaning internal credit-based flow control is engaged. 3. **Trace causes** — slow downstream dependency, too few consumers, prefetch too low (consumers idle waiting) or too high (one consumer hoards), large unacked backlog from a stuck consumer, or memory/disk watermark crossed. 4. **Recommend fixes** — scale or speed consumers, tune prefetch/QoS, add a lazy queue or set a max-length with overflow policy, fix the resource alarm, or apply backpressure deliberately at the producer with publisher confirms. 5. **Prevent recurrence** — what to alert on (queue depth trend, `messages_unacknowledged`, connections in flow, alarm state) so this is caught before publishers block. Output as: (a) the diagnosed bottleneck with the specific metric that proves it, (b) immediate mitigation, (c) root-cause fix, (d) the alerts to add. Validate any queue-policy or prefetch change on a staging broker before prod. Do not purge a backed-up queue to "relieve pressure" without review — purging discards real messages and hides the actual cause.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Why this prompt works
Backpressure incidents are confusing because three different mechanisms produce similar symptoms: slow consumers, RabbitMQ’s internal credit-based flow control, and resource alarms that block publishers outright. The prompt forces you to distinguish them using the exact metrics that tell them apart — messages_ready versus messages_unacknowledged, consumer_utilisation, and connection flow state — rather than guessing. That distinction changes the fix entirely: scaling consumers does nothing if the real problem is a disk-free alarm that has blocked every publisher.
It encodes the right mental model of unacked messages. A large messages_unacknowledged count usually means consumers have pulled work via prefetch but aren’t acking it — either because they’re slow, stuck, or prefetch is set too high and one consumer is hoarding. Reading that signal correctly is what separates a five-minute fix from an hour of restarting random services.
The guardrails address the most common harmful reflex during a backpressure incident: purging the queue to make the number go down. That destroys real messages and erases the evidence of what caused the backup. By steering toward staging validation, deliberate producer-side backpressure with publisher confirms, and the right alerts, the prompt turns a panic into a diagnosis.
Related prompts
-
RabbitMQ Memory & Disk Alarm Resource-Limit Triage Prompt
Triage a RabbitMQ memory or disk-free alarm that has blocked publishers cluster-wide, find what is consuming the resource, and recover safely without dropping messages.
-
RabbitMQ perf-test Benchmark & Capacity Plan Prompt
Design a rigorous rabbitmq-perf-test benchmark that measures publish/consume throughput, end-to-end latency, and confirm/ack overhead for a specific workload — so capacity numbers come from data, not guesses.
-
RabbitMQ Queue Max-Length & Overflow Behavior Design Prompt
Design bounded RabbitMQ queues with max-length / max-length-bytes limits and the right overflow behavior (drop-head, reject-publish, or reject-publish-dlx) so a slow consumer never exhausts broker memory or disk.
-
RabbitMQ Consumer Prefetch & QoS Tuning Prompt
Tune consumer prefetch (basic.qos) so work is spread evenly across consumers, throughput is high, and no single consumer hoards or starves while others sit idle.
More RabbitMQ prompts & error guides
Browse every RabbitMQ prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.