Skip to content

Commit

Permalink
docs: add a note about DisableAutoPipelining
Browse files Browse the repository at this point in the history
Signed-off-by: Rueian <[email protected]>
  • Loading branch information
rueian committed Nov 3, 2024
1 parent 1141b68 commit bf8de44
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ To reuse a command, use `Pin()` after `Build()` and it will prevent the command

### Auto Pipelining

All concurrent non-blocking redis commands (such as `GET`, `SET`) are automatically pipelined,
All concurrent non-blocking redis commands (such as `GET`, `SET`) are automatically pipelined by default,
which reduces the overall round trips and system calls and gets higher throughput. You can easily get the benefit
of [pipelining technique](https://redis.io/docs/manual/pipelining/) by just calling `client.Do()` from multiple goroutines concurrently.
For example:
Expand Down Expand Up @@ -99,6 +99,12 @@ Benchmark source code: https://github.com/rueian/rueidis-benchmark

A benchmark result performed on two GCP n2-highcpu-2 machines also shows that rueidis can achieve higher throughput with lower latencies: https://github.com/redis/rueidis/pull/93

### Disable auto pipelining

While auto pipelining maximizes throughput, it relys on additional goroutines to process requests and responses and may add some latencies due to goroutine scheduling and head of line blocking.

You can avoid this by setting `DisableAutoPipelining` to ture, then it will switch to connection pooling approach and serve each request with dedicated connection on the same goroutine.

### Manual Pipelining

Besides auto pipelining, you can also pipeline commands manually with `DoMulti()`:
Expand Down

0 comments on commit bf8de44

Please sign in to comment.