The following settings are used in order to tune performance:
In scenarios where handlers perform CPU intensive and not IO intensive work (such as in-memory computations), it is recommended to lower the number of threads to one and increase the
MaxDeliveryCount might require an adjustment to match the batch size, taking into account the number of messages that end up in the dead letter queue.
In scenarios where handlers perform IO intensive work, it is recommended to set the number of threads to 12 threads per logical core using
MaximumConcurrencyLevel setting and set the
BatchSize to a number of messages that takes to process. Take into account the expected (or measured) processing time and IO latency of a single message. Start with a small
BatchSize and through adjustment and measurement gradually increase it, while adjusting accordingly