Empower growth and innovation with the latest Program Dev insights

Hundreds of thousands of messages backed up in the queue, doubled the consumers and it still hasn't dropped — is the partition count the bottleneck?

Oct 10, 2026 Read: 17

When hundreds of thousands of messages pile up in a message queue and the backlog still hasn't dropped after doubling the consumers, it usually isn't because there are too few consumers — it's because effective consumption rate hasn't come up. Based on common 2026 delivery experience, first determine whether the backlog is a short pause type or a long-term imbalance type, then calculate the three numbers: backlog size, consumption rate, and production rate. Catching up only means something when consumption rate is greater than production rate. Before adding consumers, also check the three gates: partition count, ordering requirements, and downstream pressure.

First, Tell the Two Kinds of Backlog Apart: Short Pause vs. Long-Term Imbalance

A pause-type backlog means the consumer side stopped for a short time — for example, during a release restart, a downstream timeout, or abnormal retries. Its characteristic is that once the consumer side recovers, the backlog curve keeps trending downward. The way to judge it is to look at the slope of the backlog size per hour; if it keeps falling, scaling out is usually unnecessary.

An imbalance-type backlog means the production rate stays close to or even exceeds the consumption rate for a long period; the backlog rises at the same time every day and doesn't return to zero after the campaign ends. This is a capacity problem, not a recovery problem. If you treat an imbalance type as a pause type and just wait, the backlog will still be there the next day.

  • Check the slope: if the backlog is falling, it's most likely a pause type; if it's rising or flat, it's most likely an imbalance type.
  • Check the errors: if the consumer side has many timeout and retry logs, fix the retry storm first, then talk about scaling out.
  • Check per-message latency: if the per-message processing time for the same batch of messages rises from tens of milliseconds to hundreds of milliseconds, it's most likely the downstream got slower, not that there are too few consumers.

Before Deciding Whether to Add Consumers, Lay Out the Three Numbers

Judging whether a backlog can be caught up is essentially a division problem: time to catch up is approximately backlog size divided by (consumption rate minus production rate). The three numbers are the current backlog count, the consumption rate (messages/second), and the production rate (messages/second). This formula only means something when consumption rate is greater than production rate; if consumption rate is less than production rate, the catch-up time becomes negative, which means you will never catch up.

Using experience ranges as an example: with a backlog of 200,000 messages, a consumption rate of 500 messages/second, and a production rate of 200 messages/second, the difference is 300, and it can be caught up in roughly ten-plus minutes; if the consumption rate is only 250 messages/second, the difference is just 50, and the same 200,000 messages take over an hour. The absolute value of the difference determines catch-up speed more than the consumption rate itself, which is also why many teams double their consumers and see little change in the backlog curve.

  • The consumption rate should be counted per minute from consumer-side processing logs, not just taken as an average over a period — averages smooth out peaks.
  • The production rate should be measured during business peak hours, not as a full-day average.
  • If the consumption rate can't be measured at all, the consumer side lacks observability metrics, and that itself is something to fix first.

Before Adding Consumers, Confirm These Three Gates

Gate 1: Are There Enough Partitions or Queues?

In most message queue implementations, at any given moment only one consumer can receive messages from a partition. Once the number of consumer instances exceeds the number of partitions, the extra instances are basically idle, and scaling out won't increase throughput. A common approach is to increase the partition count first, then add consumers in step, keeping the two numbers roughly aligned; check the official documentation of the message queue you use for the exact relationship.

Gate 2: Are There Ordering Requirements?

If consecutive messages for the same order or the same user must be processed in order, they can't be scattered across multiple consumers for parallel processing. A workable approach is to partition by business key so that messages with the same key always land in the same partition — this allows parallelism without breaking order. Under an ordering constraint, what can run in parallel is different keys, not the same queue.

Gate 3: Can the Downstream Handle It?

The consumer side usually also writes to databases and calls third-party APIs. When consumers go from 4 to 20, database connections, row lock waits, and third-party rate limiting often break first, showing up as faster consumption but a higher failure rate, with no real gain in effective throughput. During delivery, check the downstream capacity baseline first, then decide how much to scale out.

  • Database: connection pool limit, single-table update frequency, and whether updates concentrate on the same batch of rows.
  • Third-party APIs: whether there is a QPS limit, and whether exceeding it causes queuing or outright rejection.
  • Cache: batch consumption often brings batch queries; watch out for big keys and hot keys.

Choosing Among Three Paths: Add Consumers, Improve Per-Message Efficiency, or Degrade and Drop

Scaling out is only one path. Adding consumers takes effect quickly, but it solves handling more messages at once, not slow per-message processing. By contrast, batch writes, batch acknowledgments, and reducing repeated queries per message change the per-message cost; they take effect more slowly, but last longer when capacity keeps growing. The key to choosing is whether the backlog is a short-term peak or a long-term trend.

  • Add consumers: the experience range is a few minutes to ten-plus minutes to see the curve clearly turn downward; limited by partition count and downstream capacity, it suits short-term peaks.
  • Improve per-message efficiency: change row-by-row database writes to batch commits and batch acknowledgments; a common batch range is 50–200 messages per batch, which often multiplies throughput, but pay attention to the handling semantics when part of a batch fails.
  • Degrade or transfer: only suits messages that can be replayed or discarded, such as logs, tracking events, and statistics; state-changing messages such as orders, payments, and notifications can't be solved by dropping them.

Three Common Pitfalls

  • Mistaking a retry storm for a capacity problem: messages keep failing and being redelivered, which looks like a backlog but is actually the consumption logic reporting errors.
  • Forgetting to reclaim after scaling out: no one takes the temporarily added consumer instances offline, and higher costs are discovered only later.
  • Watching only the queue and not the business: the backlog is cleared, but downstream state is written incorrectly — the problem has just moved elsewhere.

A Piece of Experience from the Delivery Site

A more common situation at the delivery site is this: the constraints are fairly hard, the client won't accept dropped messages, and the consumer side also has to call a third-party API with a QPS limit. In this case, the usual approach is to first confirm there are no errors on the consumer side (ruling out a retry storm), then expand partitions by business key and raise the consumer count to align with the partitions, while changing per-message calls to batch commits and batch acknowledgments. Following this order, for a backlog of over 100,000 messages at one time, the experience range is tens of minutes to two hours to catch up. The cost is also clear: the temporarily adjusted batch size and acknowledgment method usually need a regression test the next day, because batch acknowledgment amplifies the handling semantics of partial failures, and a small oversight can cause individual messages to be processed more than once. Stop the bleeding first, then run the regression — that's a fairly common rhythm on projects.

Applicable Scenarios and Boundaries

Situations where this judgment approach fits: asynchronous pipelines with an independent consumer side, observable backlog size, and a business that can tolerate delays of a few minutes to a few hours — for example, notification push, reconciliation, statistical aggregation, and data synchronization. In these scenarios, scaling out and batch optimization are usually effective.

Situations where it doesn't fit and this approach isn't needed: in a synchronous call chain where a user is waiting for a result, that isn't a queue backlog problem but a problem of API timeouts and synchronous waiting design; for a single queue with strict ordering that can't be partitioned by business key, adding consumers directly breaks the order; when the downstream is high-frequency updates to the same batch of rows in the same table, scaling out only makes lock waits more obvious. The essence of a queue backlog is the relationship between production rate and consumption rate; scaling capacity is only one term in that equation, and when the equation itself doesn't hold, scaling out is meaningless.

Frequently Asked Questions

Roughly how long does it take to consume a backlog of hundreds of thousands of messages?

Estimate it as backlog size divided by the rate difference; the larger the difference, the faster it goes. If the difference is smaller than the normal fluctuation in production rate, the catch-up time keeps getting extended and may never catch up.

The consumers have already been doubled — why hasn't the backlog dropped noticeably?

The usual reason is that the number of consumers exceeds the number of partitions/shards, so the extra instances are idle, or the bottleneck has shifted to the downstream database and third-party APIs.

Can we just clear the backlog queue and start over?

It only suits replayable or discardable data such as logs and tracking events; clearing state-changing messages such as orders, payments, and notifications means losing orders, so first confirm whether there is a replay source.

When ordered messages are backed up, can we temporarily spin up more consumers?

Messages with the same business key can't be processed in parallel, or the order breaks; a common approach is to expand partitions by business key so that different keys run in parallel and the same key runs in sequence.

How can we detect a backlog early instead of waiting for users to complain?

Monitoring the growth slope of the unacknowledged count or consumption lag is more effective than watching only the absolute count; based on common 2026 practice, five to ten minutes of monotonic increase is worth a look.


When you hit a backlog, don't rush to scale out: lay out the backlog curve, consumption rate, and production rate, determine whether it's a pause type or an imbalance type, then decide whether to add consumers, improve per-message efficiency, or degrade handling. During delivery, these steps get turned into an on-call checklist to avoid blind scaling at midnight. For core pipelines with strict ordering and strong consistency, temporary scaling can't replace capacity planning and rate-limiting design.

Have a similar project in mind?
Contact us for a one-to-one project reference proposal
Obtain Proposal
Are you ready?
Then reach out to us!
+86-13370032918
Discover more services, feel free to contact us anytime.
Please fill in your requirements
What services would you like us to provide for you?
Your Budget
ct.
Our WeChat
Professional technical solutions
Phone
+86-13370032918 (Manager Jin)
The phone is busy or unavailable; feel free to add me on WeChat.
E-mail
349077570@qq.com
Submitted successfully
Thank you for your trust. We will contact you soon!
Recommended projects for you