Consumer creation lagging and timeout #863
-
Describe the bugFor a serial creation of 300 named consumers for a single stream with pre-existing messages, each creation may take various seconds or even be timeout. If there is no existing messages of the stream prior the creation flow, it can be all good and finished very quickly in a few seconds. Please be noted, as long as there is 1 message prior the creation flow, it can be problematic. Changing the invterval of each consumer creation can mitigate or worse the issue for it to appear. Server be running on the same machine of the app or a separate one ( eg, docker). Attached the reproducing gradle app. The log of the failed case with 10ms interval: ./gradlew run
The log of failed case with 1 second interval: ./gradlew run
Reproduction stepsServer ver: 4.1.3 (brew), 4.1 (docker)
Expected behaviorAll 300 consumer should be created sucessfuly without lagging or timeout, just like the behavior when there is no existing msg of the stream. Additional contextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
|
Thanks for the detailed analysis. I managed to reproduce the behavior locally. You should use the The example combines several factors that combined trigger this issue (255 consumers per connection by default, only 1 node, all consumers on the same, 300 consumers, which can be considered a significant amount for 1 connection). I would not consider this example completely realistic though. If you are testing RabbitMQ streams for a project, you are welcome to share more about your use case so we can discuss it. Nevertheless I identified a problem on the server side that makes the problem go away. It will require more testing, so should go in 4.2.1 as 4.2.0 is scheduled for new week and we are in code-freeze period. I'll update this discussion accordingly. |
Beta Was this translation helpful? Give feedback.
Thanks for the detailed analysis. I managed to reproduce the behavior locally. You should use the
EnvironmentBuilder#maxConsumersByConnection(int)method to avoid having 255 consumers per connection. This default is OK for an application with consumers that does not consume from the same stream.The example combines several factors that combined trigger this issue (255 consumers per connection by default, only 1 node, all consumers on the same, 300 consumers, which can be considered a significant amount for 1 connection). I would not consider this example completely realistic though. If you are testing RabbitMQ streams for a project, you are welcome to share more about your use case so we…