diff --git a/cmd/drainer/drainer.toml b/cmd/drainer/drainer.toml index e3d77d200..d3934c41e 100644 --- a/cmd/drainer/drainer.toml +++ b/cmd/drainer/drainer.toml @@ -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 @@ -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. diff --git a/drainer/config.go b/drainer/config.go index 5ac79f8c0..02e75705b 100644 --- a/drainer/config.go +++ b/drainer/config.go @@ -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")