Repository navigation
Description
Search before reporting
- I searched in the issues and found nothing similar.
Read release policy
- I understand that unsupported versions don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.
User environment
- Pulsar
5.0.0-M1-SNAPSHOT, built from a recentmastersnapshot - Pulsar standalone on Linux x86_64 with OpenJDK 21
- Java client built from the same source snapshot
Issue Description
For a Shared subscription with many consumers, frequently connecting and disconnecting additional consumers can leave the subscription with significantly lower throughput after the reconnect activity stops.
The test compares two subscriptions on the same topic:
- Subscription without reconnects: 1,000 long-lived consumers and no additional consumer activity.
- Subscription with reconnects: 1,000 long-lived consumers, plus 1,600 temporary consumers that connect and disconnect during the test.
The throughput is expected to recover after the temporary consumers disconnect. Instead, the subscription with reconnects can remain about 30–40% slower while the producer and the original consumers continue running normally.
Error messages
No error or exception was observed. The problem appears as a sustained throughput drop.
Reproducing the issue
- Continuously publish about 50,000 messages per second to a persistent, non-partitioned topic.
- Create the two Shared subscriptions described above and start their long-lived consumers.
- On the subscription with reconnects only, rapidly create and close 1,600 additional consumers in concurrent waves.
- After the temporary consumers disconnect, keep the producer and both long-lived consumer groups running and compare their throughput.
The producer, long-lived consumer groups, and reconnect workload run in separate JVM processes.
Additional information
The test was repeated eight times with fresh standalone state. Before the reconnect workload, the two subscriptions had nearly identical throughput. The table shows their throughput after all temporary consumers disconnected:
| Run | Without reconnects | With reconnects | Difference |
|---|---|---|---|
| 1 | 19,430 msg/s | 18,859 msg/s | 2.9% lower |
| 2 | 21,132 msg/s | 14,001 msg/s | 33.7% lower |
| 3 | 20,913 msg/s | 12,646 msg/s | 39.5% lower |
| 4 | 28,342 msg/s | 28,351 msg/s | Similar |
| 5 | 19,251 msg/s | 18,273 msg/s | 5.1% lower |
| 6 | 21,297 msg/s | 14,428 msg/s | 32.3% lower |
| 7 | 19,728 msg/s | 19,691 msg/s | 0.2% lower |
| 8 | 22,444 msg/s | 15,229 msg/s | 32.1% lower |
Are you willing to submit a PR?
- I'm willing to submit a PR!
Activity
[-][Bug] Shared subscription throughput can persistently drop by 30-40% after frequent consumer reconnects[/-][+][Bug] Shared subscription throughput can remain 30–40% lower after frequent consumer reconnects[/+]