@@ -61,6 +61,20 @@ type UniversalOptions struct {
61
61
WriteTimeout time.Duration
62
62
ContextTimeoutEnabled bool
63
63
64
+ // ReadBufferSize is the size of the bufio.Reader buffer for each connection.
65
+ // Larger buffers can improve performance for commands that return large responses.
66
+ // Smaller buffers can improve memory usage for larger pools.
67
+ //
68
+ // default: 256KiB (262144 bytes)
69
+ ReadBufferSize int
70
+
71
+ // WriteBufferSize is the size of the bufio.Writer buffer for each connection.
72
+ // Larger buffers can improve performance for large pipelines and commands with many arguments.
73
+ // Smaller buffers can improve memory usage for larger pools.
74
+ //
75
+ // default: 256KiB (262144 bytes)
76
+ WriteBufferSize int
77
+
64
78
// PoolFIFO uses FIFO mode for each node connection pool GET/PUT (default LIFO).
65
79
PoolFIFO bool
66
80
@@ -143,6 +157,9 @@ func (o *UniversalOptions) Cluster() *ClusterOptions {
143
157
WriteTimeout : o .WriteTimeout ,
144
158
ContextTimeoutEnabled : o .ContextTimeoutEnabled ,
145
159
160
+ ReadBufferSize : o .ReadBufferSize ,
161
+ WriteBufferSize : o .WriteBufferSize ,
162
+
146
163
PoolFIFO : o .PoolFIFO ,
147
164
148
165
PoolSize : o .PoolSize ,
@@ -200,6 +217,9 @@ func (o *UniversalOptions) Failover() *FailoverOptions {
200
217
WriteTimeout : o .WriteTimeout ,
201
218
ContextTimeoutEnabled : o .ContextTimeoutEnabled ,
202
219
220
+ ReadBufferSize : o .ReadBufferSize ,
221
+ WriteBufferSize : o .WriteBufferSize ,
222
+
203
223
PoolFIFO : o .PoolFIFO ,
204
224
PoolSize : o .PoolSize ,
205
225
PoolTimeout : o .PoolTimeout ,
@@ -250,6 +270,9 @@ func (o *UniversalOptions) Simple() *Options {
250
270
WriteTimeout : o .WriteTimeout ,
251
271
ContextTimeoutEnabled : o .ContextTimeoutEnabled ,
252
272
273
+ ReadBufferSize : o .ReadBufferSize ,
274
+ WriteBufferSize : o .WriteBufferSize ,
275
+
253
276
PoolFIFO : o .PoolFIFO ,
254
277
PoolSize : o .PoolSize ,
255
278
PoolTimeout : o .PoolTimeout ,
0 commit comments