mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-20 15:16:42 +00:00
app/vminsert: add -rpc.disableCompression
command-line flag for reducing CPU usage at the cost of higher network bandwidth usage
This commit is contained in:
parent
b23352dc9e
commit
f37903adb3
1 changed files with 6 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
package netstorage
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"sync"
|
||||
"time"
|
||||
|
@ -12,6 +13,8 @@ import (
|
|||
"github.com/VictoriaMetrics/metrics"
|
||||
)
|
||||
|
||||
var disableRPCCompression = flag.Bool(`rpc.disableCompression`, false, "Disable compression of RPC traffic. This reduces CPU usage at the cost of higher network bandwidth usage")
|
||||
|
||||
// sendWithFallback sends buf to storage node sn.
|
||||
//
|
||||
// It falls back to sending data to another storage node if sn is currently
|
||||
|
@ -101,6 +104,9 @@ func (sn *storageNode) dial() error {
|
|||
}
|
||||
|
||||
compressionLevel := 1
|
||||
if *disableRPCCompression {
|
||||
compressionLevel = 0
|
||||
}
|
||||
bc, err := handshake.VMInsertClient(c, compressionLevel)
|
||||
if err != nil {
|
||||
_ = c.Close()
|
||||
|
|
Loading…
Reference in a new issue