CosmosClientOptions.MaxRequestsPerTcpConnection Property

Definition

(Direct/TCP) Controls the number of requests allowed simultaneously over a single TCP connection. When more requests are in flight simultaneously, the direct/TCP client will open additional connections.

public int? MaxRequestsPerTcpConnection { get; set; }
member this.MaxRequestsPerTcpConnection : Nullable<int> with get, set
Public Property MaxRequestsPerTcpConnection As Nullable(Of Integer)

Property Value

The default settings allow 30 simultaneous requests per connection. Do not set this value lower than 4 requests per connection or higher than 50-100 requests per connection.
The former can lead to a large number of connections to be created. The latter can lead to head of line blocking, high latency and timeouts.

Remarks

Applications with a very high degree of parallelism per connection, with large requests or responses, or with very tight latency requirements might get better performance with 8-16 requests per connection.

Applies to