When to use LimitMessageProcessingConcurrencyTo

Hello team , I want to know , when to use LimitMessageProcessingConcurrencyTo .

and if i setup the value for LimitMessageProcessingConcurrencyTo = 500 any harm for it .

we have Nservice bus where queue message get stuck if i push 150 message at a time .

for that solution we added LimitMessageProcessingConcurrencyTo config and now it is working fine .

By default LimitMessageProcessingConcurrencyTo is set to match the number of processors.

This setting is meant to allow you to lower the number of concurrent threads for message processing.

Raising the value above the number of processors will result in extra threads being created in Windows thread pool, but this will not increase processing power. Instead Windows will interleave those threads.

If pushing 150 messages to your queue causes the endpoint to “stick”, then there is likely another underlying problem that needs to be resolved.

If you need assistance troubleshooting why messages are becoming stuck I would open a support case so we can help you troubleshoot why messages are becoming stuck.

You definitely need to find root cause of this dead lock.

Wouldn’t it be advisabel to set it higher if the message handlers are doing lots of IO bound work? (vs CPU bound)

Wouldn’t it be advisabel to set it higher if the message handlers are doing lots of IO bound work? (vs CPU bound)

Possibly. More concurrent threads doesn’t necessarily mean individual work will be done faster, just that more requests for work will be done. It could mean individual threads take longer, because now they have to wait for CPU time before they can resume. That isn’t necessarily good or bad, just something that isn’t always obvious to everyone implementing async.