-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Receiving "Too much pending tasks" error when we use the library to send multiple concurrent messages from a node express app #3376
Comments
@arulselvam This is by design. Is there a need to send concurrently? |
@amarzavery , We are using await client.sendBatch. Our requirement is to send the messages that we receive in our incoming http requests to Event Hubs. Since there are multiple concurrent incoming http requests, we end up making concurrent calls to |
I see. To give you some context: Multiple concurrent calls to send() are made. All of them try to establish a sender link if there isn't one. There is an async lock on that. Once the link is established then messages can be sent on that link. Requests to create the link are queued. When it reaches a particular threshold then There are multiple approaches that you can take.
|
Thanks for the suggestions. I ended up using the REST api for now. |
I still believe that you can achieve decent speed by keeping the send calls sequential. I was able to send 6million messages per minute (for ~3 days) to an event hub in a 100TU namespace using 5 clients on 5 different vms. You can check the graph here. I was sending 1000 messages of 256 bytes each batched together. This is the link to the send command in our test CLI. |
I believe we can update our library such that if a sender link is in the process of being created, then future send requests waits for the sender link to be created instead of requesting new sender links. Is there any reason you can think of where we cannot do this? |
With the use of @chradek, @richardpark-msft Can either of you verify and then close this issue? |
@chradek , I'll take a look. |
Just tried this out - the API surface has changed so I ended up sending 2000 individual batches with one message apiece, simultaneously. No issue. Also, traced down the code and we are indeed using AwaitableSender now. Closing. |
Receiving "Too much pending tasks" error when we use the library to send messages from a node express app. The issue occurs when we make multiple concurrent calls to
await client.send(eventData)
To Reproduce
Make multiple concurrent calls to
await client.send(eventData)
Package-name: azure-event-hubs
Package-version: 0.2.5
node.js version: 10.0.0
OS name and version: Azure App Service ,node-express app, Windows
Error Call stack
The text was updated successfully, but these errors were encountered: