Skip to content

feat(config): expose TCP_NODELAY socket option #490

Description

@currantw

Describe the feature

Expose the TCP_NODELAY socket option in the C# client configuration. This controls
Nagle's algorithm — when enabled (true), small packets are sent immediately without
buffering, reducing latency for typical Redis/Valkey workloads. When disabled (false),
the OS may buffer small writes to reduce packet count at the cost of up to ~200ms latency.

All other GLIDE clients already expose this:

Client Location Name Type Default
Python AdvancedBaseClientConfiguration tcp_nodelay Optional[bool] True via core
Java AdvancedBaseClientConfiguration tcpNoDelay Boolean true via core
Node Connection options tcpNoDelay boolean? true via core
Go AdvancedClientConfiguration tcpNoDelay *bool true via core

The C# client does not currently expose this option.

Use Case

Users running latency-sensitive workloads benefit from the default (true). Users on
high-throughput batch pipelines with many small commands may want to explicitly set it to
false to reduce packet overhead. Exposing the option gives users the same control
available in every other GLIDE client.

Proposed Solution

Add a TcpNoDelay property (bool?) to an advanced configuration class (or the existing
connection configuration builder). When set, pass it through to the protobuf
ConnectionRequest.tcp_nodelay field. When null, omit it from the request so the Rust
core applies its default (true).

Acknowledgements

  • I may be able to implement this feature request
  • This feature might cause a breaking change

Related

  • Python: glide-shared/glide_shared/config.py (AdvancedBaseClientConfiguration)
  • Java: AdvancedBaseClientConfiguration.java
  • Node: BaseClient.ts
  • Go: config/config.go
  • Rust core: glide-core/src/client/types.rs

Additional Information

⚪ None

Metadata

Metadata

Assignees

Labels

coreCore library (`sources/Valkey.Glide/`)triageNeeds triage — not yet reviewed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions