Skip to content

Commit

Permalink
drainer/* change more reasonable default config value (#439)
Browse files Browse the repository at this point in the history
* drainer/* change more reasonable default config value
  • Loading branch information
july2993 committed Jan 22, 2019
1 parent aca3043 commit d73ac56
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions cmd/drainer/drainer.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ pd-urls = "http://127.0.0.1:2379"
ignore-schemas = "INFORMATION_SCHEMA,PERFORMANCE_SCHEMA,mysql"

# number of binlog events in a transaction batch
txn-batch = 1
txn-batch = 20

# work count to execute binlogs
worker-count = 1
# if the latency between drainer and downstream(mysql or tidb) are too high, you might want to increase this
# to get higher throughput by higher concurrent write to the downstream
worker-count = 16

disable-dispatch = false

Expand Down Expand Up @@ -60,10 +62,9 @@ host = "127.0.0.1"
user = "root"
password = ""
port = 3306
# Time and size limits for flash batch write
# time-limit = "30s"
# size-limit = "100000"

[syncer.to.checkpoint]
# you can uncomment this to change the database to save checkpoint when the downstream is mysql or tidb
#schema = "tidb_binlog"

# Uncomment this if you want to use pb or sql as db-type.
Expand Down
4 changes: 2 additions & 2 deletions drainer/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ func NewConfig() *Config {
fs.StringVar(&cfg.LogFile, "log-file", "", "log file path")
fs.StringVar(&cfg.LogRotate, "log-rotate", "", "log file rotate type, hour/day")
fs.Int64Var(&cfg.InitialCommitTS, "initial-commit-ts", 0, "if drainer donesn't have checkpoint, use initial commitTS to initial checkpoint")
fs.IntVar(&cfg.SyncerCfg.TxnBatch, "txn-batch", 1, "number of binlog events in a transaction batch")
fs.IntVar(&cfg.SyncerCfg.TxnBatch, "txn-batch", 20, "number of binlog events in a transaction batch")
fs.StringVar(&cfg.SyncerCfg.IgnoreSchemas, "ignore-schemas", "INFORMATION_SCHEMA,PERFORMANCE_SCHEMA,mysql", "disable sync those schemas")
fs.IntVar(&cfg.SyncerCfg.WorkerCount, "c", 1, "parallel worker count")
fs.IntVar(&cfg.SyncerCfg.WorkerCount, "c", 16, "parallel worker count")
fs.StringVar(&cfg.SyncerCfg.DestDBType, "dest-db-type", "mysql", "target db type: mysql or tidb or pb or flash or kafka; see syncer section in conf/drainer.toml")
fs.BoolVar(&cfg.SyncerCfg.DisableDispatch, "disable-dispatch", false, "disable dispatching sqls that in one same binlog; if set true, work-count and txn-batch would be useless")
fs.BoolVar(&cfg.SyncerCfg.SafeMode, "safe-mode", false, "enable safe mode to make syncer reentrant")
Expand Down

0 comments on commit d73ac56

Please sign in to comment.