Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions universal.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,20 @@ type UniversalOptions struct {
WriteTimeout time.Duration
ContextTimeoutEnabled bool

// ReadBufferSize is the size of the bufio.Reader buffer for each connection.
// Larger buffers can improve performance for commands that return large responses.
// Smaller buffers can improve memory usage for larger pools.
//
// default: 256KiB (262144 bytes)
ReadBufferSize int

// WriteBufferSize is the size of the bufio.Writer buffer for each connection.
// Larger buffers can improve performance for large pipelines and commands with many arguments.
// Smaller buffers can improve memory usage for larger pools.
//
// default: 256KiB (262144 bytes)
WriteBufferSize int

// PoolFIFO uses FIFO mode for each node connection pool GET/PUT (default LIFO).
PoolFIFO bool

Expand Down Expand Up @@ -143,6 +157,9 @@ func (o *UniversalOptions) Cluster() *ClusterOptions {
WriteTimeout: o.WriteTimeout,
ContextTimeoutEnabled: o.ContextTimeoutEnabled,

ReadBufferSize: o.ReadBufferSize,
WriteBufferSize: o.WriteBufferSize,

PoolFIFO: o.PoolFIFO,

PoolSize: o.PoolSize,
Expand Down Expand Up @@ -200,6 +217,9 @@ func (o *UniversalOptions) Failover() *FailoverOptions {
WriteTimeout: o.WriteTimeout,
ContextTimeoutEnabled: o.ContextTimeoutEnabled,

ReadBufferSize: o.ReadBufferSize,
WriteBufferSize: o.WriteBufferSize,

PoolFIFO: o.PoolFIFO,
PoolSize: o.PoolSize,
PoolTimeout: o.PoolTimeout,
Expand Down Expand Up @@ -250,6 +270,9 @@ func (o *UniversalOptions) Simple() *Options {
WriteTimeout: o.WriteTimeout,
ContextTimeoutEnabled: o.ContextTimeoutEnabled,

ReadBufferSize: o.ReadBufferSize,
WriteBufferSize: o.WriteBufferSize,

PoolFIFO: o.PoolFIFO,
PoolSize: o.PoolSize,
PoolTimeout: o.PoolTimeout,
Expand Down
Loading