-
Notifications
You must be signed in to change notification settings - Fork 494
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
Bulk operations delay #1277
Comments
Have you looked at the Bulk congestion control? There is TransactionalBatch support if you want more control. @ealsur any suggestions? |
The reasons for not having an explicit API to define a Bulk is because the current approach allows for multiple concurrent threads/process across the span of the entire Application to benefit. If an Application has multiple workers or threads sending operations concurrently, all these concurrent operations are grouped and processed regardless of their origin and the context of the caller. Bulk support was added but the scenario is the same as the old Bulk Executor Library, it is meant to be used with large amount of documents, not small sets. For small sets (<=100) the performance benefit over just doing them as point operations (Bulk disabled) is just not big enough. The benefit starts to grow as more operations are involved. The only improvement I can see in your case is increase the Also consider caching the Container instance if it's going to be the same always. |
Please reopen if you have further results after changing the configuration on the Trigger |
Hi,
regarding the feedback wanted in https://devblogs.microsoft.com/cosmosdb/introducing-bulk-support-in-the-net-sdk/ , especially the bit where the containe waits for 1s to post all he data (if the batches aren't full):
Why not handing the container the tasks? Or the documents, or some kind of batch? That way the container knows precisely how many operations to do and doesn't need to wait.
My current scenario is migrating documents from one cosmos db container to another, using an azure function hanging on the change feed. There I get batches of max 100 documents and want to send them on as fast as possible, possible using a maximum rate.
So, the batches are small and the function is called often. Here, the delay is less than optimal.
Here's a sample code illustrating my use case:
Nevertheless, brilliant job. :-)
The text was updated successfully, but these errors were encountered: