Repository navigation
Conversation
warwickschroeder
left a comment
There was a problem hiding this comment.
A potential concern is that existing installs change behaviour on upgrade with these new defaults.
| routing.EnableMessageDrivenPubSubCompatibilityMode(); | ||
| #pragma warning restore CS0618 // Type or member is obsolete | ||
|
|
||
| transportSettings.MaxConcurrency ??= 10; |
There was a problem hiding this comment.
I think this ??= 10 may have been protecting the connection pool. SqlServer transport holds a pooled connection for the whole receive (ProcessWithNativeTransaction), and our ingestion receives don't return until their batch is written, so 100 concurrency uses all 100 connections in the default pool. Any dispatch inside the batch that needs a fresh connection (e.g. audit control messages) then waits for the pool timeout. The error instance also runs four receivers on one pool, which 4 × 10 used to fit. The testing tool defaults to RabbitMQ, so it doesn't cover this. Have these new defaults been tested with all transports?
| { | ||
| transportDefinition.TransportTransactionMode = TransportTransactionMode.SendsAtomicWithReceive; | ||
|
|
||
| transportSettings.MaxConcurrency ??= 10; |
There was a problem hiding this comment.
Npgsql also defaults to a pool of 100, so the SQL Server pool concern applies here for both the primary and audit endpoints.
Updated PR to only change ingestion batching config and leave the transport defaults alone. If existing installs have increased these values the default batch size will scale appropriately. Also reduced the default writer threads to 2, which will be more likely to evenly divide into the transport parallelism value - avoiding writers being starved under heavy ingestion load. |
Summary
Use two ingestion writers where storage supports concurrent batches, split the default batch size across those writers, and wait up to 100 ms for partial batches to fill. Keep transport concurrency defaults unchanged.
Why
A batch sized to the full receive concurrency can occupy every receive slot while other writers have no messages to process. Dividing the concurrency across writers allows multiple full batches to be written concurrently. Two writers divide both existing transport defaults, 10 and 32, evenly.
The timeout lets partial batches collect more messages before storage writes begin. It trades latency for fuller batches as testing found that a zero timeout would rarely allow a full batch to be written decreasing total throughput.
Behavior
Transport concurrency remains 10 for error ingestion and 32 for audit ingestion, except SQL Server and PostgreSQL transports, where audit ingestion remains at 10.