set sender count to 4096 if target redis type is cluster

v4
vinllen 5 years ago
parent 09d5211536
commit 24e8c4f712
  1. 2
      conf/redis-shake.conf
  2. 3
      src/redis-shake/main/main.go

@ -189,7 +189,7 @@ sender.size = 104857600
# sender flush buffer size of oplog number. # sender flush buffer size of oplog number.
# used in `sync`. # used in `sync`.
# 发送缓存的报文个数,超过这个阈值将会强行刷缓存发送 # 发送缓存的报文个数,超过这个阈值将会强行刷缓存发送
sender.count = 5000 sender.count = 4096
# delay channel size. once one oplog is sent to target redis, the oplog id and timestamp will also # delay channel size. once one oplog is sent to target redis, the oplog id and timestamp will also
# stored in this delay queue. this timestamp will be used to calculate the time delay when receiving # stored in this delay queue. this timestamp will be used to calculate the time delay when receiving
# ack from target redis. # ack from target redis.

@ -396,6 +396,9 @@ func sanitizeOptions(tp string) error {
// set to default when not set // set to default when not set
conf.Options.SenderCount = defaultSenderCount conf.Options.SenderCount = defaultSenderCount
} }
if conf.Options.TargetType == conf.RedisTypeCluster && conf.Options.SenderCount > utils.RecvChanSize {
conf.Options.SenderCount = utils.RecvChanSize
}
if conf.Options.SenderDelayChannelSize == 0 { if conf.Options.SenderDelayChannelSize == 0 {
conf.Options.SenderDelayChannelSize = 32 conf.Options.SenderDelayChannelSize = 32

Loading…
Cancel
Save