question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[QUERY] Manipulate Prefetch for better processing

See original GitHub issue

Library name and version

Try migrate Microsoft.Azure.WebJobs.Extensions.ServiceBus 4.2.2 to Microsoft.Azure.WebJobs.Extensions.ServiceBus 5.2.0

Query/Question

Hi

I created some feature that was based on MessageReceiver from Microsoft.Azure.WebJobs.Extensions.ServiceBus 4.2.2 That was manipulated a Prefetch to better fit the amount of getting the message so process as big as possible batches but including the condition of application e.g.:

  • scale batch size between 1-X messages by attribute (to prevent throttling of knowing functions)
  • scale down if a batch of messages is too slow processed (and future prefetched messages may be expired before it is even started)
  • scale up if processing work fast
  • scale to 1 when start receiving dependant service errors (and append delay to get next message)

Now when try to take ServiceBusReceiver from Microsoft.Azure.WebJobs.Extensions.ServiceBus 5.2.0 I can’t change ServiceBusReceiver Prefetch or even get it (previously I use IBinding and took “MessageReceiver” from context.BindingData, but now all of them return ServiceBusMessageActions)

Could you tell me is there any possible way to change Prefetch in runtime? Or do you have any plan to make it?

Environment

.NET SDK Version: 6.0.100 Commit: 9e8b04bbff

Runtime environment: OS Name: Windows OS Version: 10.0.19044 OS Platform: Windows RID: win10-x64

Host (useful for support): Version: 6.0.0 Commit: 4822e3c3aa

IDE: Visual Studio 2022 (v. 17.0.2)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
KondzioSSJ4commented, Feb 10, 2023

Hi

It looks like 5.8.1 version of Microsoft.Azure.WebJobs.Extensions.ServiceBus solved all my needs

So I can use IBinding to take a MessageReceiver and then use reflection to change Prefetch and it will be applied when the last batch will be consumed, what is good enough

Thanks, for me you can close a ticket

1reaction
JoshLove-msftcommented, Jan 4, 2022

I don’t think this issue is specific to the extensions, as when using the SDK directly you are not able to modify the Prefetch count for a running receiver.

We haven’t heard of this request before - we can take it into consideration.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SQL Server Prefetch and Query Performance - Simple Talk
Another good way to analyze the prefetching performance is looking at the Current Disk Queue Length disk counter in the performance monitor. We ......
Read more >
Improving query performance by prefetching pages
Asynchronous prefetch issues I/O requests for pages before the query needs them so that most pages are in cache by the time query...
Read more >
Speed up SQL Server queries with PREFETCH
Conclusion, this tip was mainly aimed at illustrating how Prefetch can speed up query execution and how the different number of rows can...
Read more >
Prefetching data into the buffer pool
Prefetching pages means that one or more pages are retrieved from disk in the expectation that they will be required by an application....
Read more >
Holistic optimization by prefetching query results
In this paper we address the problem of optimizing performance of database/web-service backed applications by means of automatically ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found