NServiceBus.SqlServer icon indicating copy to clipboard operation
NServiceBus.SqlServer copied to clipboard

Competing-consumer deployments might result in wasted `Select` queries

Open tmasternak opened this issue 3 years ago • 0 comments

Connected to: https://discuss.particular.net/t/performance-issues-on-upgrade-of-nservicebus-transport-sqlserver-from-6-0-1-to-6-2-0/2451/5

When multiple physical endpoints query the length of the input queue at the same time and the input queue size is less than peeking batch size (100 messages) majority of the Select statements for message receive will return empty results.

E.g. if there are 3 receiving endpoints and the are 50 messages in the input queue the following scenario can happen:

  • All 3 instances query the size and get 50 as a result
  • All 3 instances generate 50 Select statements to receive individual messages
  • 100 of the Select statements will result in empty results.

tmasternak avatar Jun 22 '21 09:06 tmasternak