Hi @Suresh Thakur, Kirti thanks for reaching out!
From your question it's not clear that your workload is running on dev | prod environment. I would assume it's a dev environment and your SB is configured with standard tier. The error indicates that you're exceeding the max number of concurrent connections on an SB namespace which is 5000. I believe partitioning is enabled right?? I see some architectural issues here...
To handle the Throttling please consider following suggestions:
- Enable retry mechanism to handle the transient errors -> here is the link
- Instead of scaling out the func app, consider processing messages in batch
- Enable prefetchCount setting in host.json (it specifies the number of messages the func will fetch and hold in memory at a time), fetching multiple messages at once we can reduce the number of roundtrips, improving the throughput and reducing latency. Please don't set it to some higher number!
- For Initial setup try the following in your host.json and adjust accordingly
{
"serviceBus": {
"maxConcurrentCalls": 16,
"prefetchCount": 100,
"autoRenewTimeout": "00:05:00",
"autoComplete": true
}
}
- consider switching to Premium SB tier if your workload demands higher throughput & it's a production env.
- For more infos, please refer the following https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-performance-improvements?tabs=net-standard-sdk-2
Hope that helps!