From c2fd8dc1983f92bb93cba668541f29c7646b3586 Mon Sep 17 00:00:00 2001 From: ofekshenawa Date: Sun, 3 Aug 2025 17:19:43 +0300 Subject: [PATCH] Add description for buffer size parameter --- options.go | 2 ++ osscluster.go | 2 ++ ring.go | 2 ++ 3 files changed, 6 insertions(+) diff --git a/options.go b/options.go index d717e567..2ce807e4 100644 --- a/options.go +++ b/options.go @@ -133,12 +133,14 @@ type Options struct { // 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: 0.5MiB (524288 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: 0.5MiB (524288 bytes) WriteBufferSize int diff --git a/osscluster.go b/osscluster.go index 197bf978..ad654821 100644 --- a/osscluster.go +++ b/osscluster.go @@ -94,12 +94,14 @@ type ClusterOptions struct { // 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: 0.5MiB (524288 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: 0.5MiB (524288 bytes) WriteBufferSize int diff --git a/ring.go b/ring.go index 3a8ab750..0d73e010 100644 --- a/ring.go +++ b/ring.go @@ -116,12 +116,14 @@ type RingOptions struct { // 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: 0.5MiB (524288 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: 0.5MiB (524288 bytes) WriteBufferSize int