Tuning endpoint message processing

Component: NServiceBus
NuGet Package NServiceBus (7.4)

NServiceBus uses defaults that ensure good performance in common cases. While this is usually the preferred mode of operation there are situations where tuning might be desired.

Tuning concurrency

The default concurrency limit is max(Number of logical processors, 2).

Limit maximum concurrency so that no more messages than the specified value are ever processed at the same time. If a maximum concurrency is not specified, the transport will choose an optimal value that is a balance between throughput and effective resource usage.

Sequential processing:

Set the concurrently limit value to 1 to process messages sequentially.

Sequential processing is not a guarantee for ordered processing. For example, processing failures and [/nservicebus/recoverability] can result in out-of-order processing.

Examples where concurrency tuning might be relevant are:

  • Non thread safe code that needs to run sequentially
  • Databases that might deadlock when getting too many concurrent requests
The endpoint needs to be restarted for concurrency changes to take effect.


Throughput throttling options have been deprecated. To enable throttling on Version 6 and higher, a custom behavior should be used. The throttling sample demonstrates how such a behavior can be implemented.


The default concurrency settings of an endpoint can be changed via code:


TimeoutManager satellite queues

Depending on the chosen transport, additional queues (satellite queues) may be used to handle deferred messages like delayed retries or timeouts. Satellite queues use the default concurrency configuration. This concurrency setting can be configured using:

var timeoutManager = endpointConfiguration.TimeoutManager();

Related Articles

Last modified