Skip to content

Commit

Permalink
util/rpc: adjust zstd Encoder parameters
Browse files Browse the repository at this point in the history
Don't bother with multithreading for the RPC encoder and limit the window size to 16k.
(Attempt to reduce server memory use.)
  • Loading branch information
mmp committed Feb 2, 2025
1 parent f0e5671 commit 0c5c7db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/util/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func MakeCompressedConn(c net.Conn) (*CompressedConn, error) {
if cc.r, err = zstd.NewReader(c); err != nil {
return nil, err
}
if cc.w, err = zstd.NewWriter(c); err != nil {
if cc.w, err = zstd.NewWriter(c, zstd.WithEncoderConcurrency(1), zstd.WithWindowSize(16384)); err != nil {
return nil, err
}
return cc, nil
Expand Down

0 comments on commit 0c5c7db

Please sign in to comment.