总结下:
从之前的图表迁移很快,我猜测是因为有一堆空的region,所以那一部分迁移非常快,后面慢是因为有真实数据,开启空regionmerge后磁盘占用和region量明显降低
我所做的处理
1:开启空regionmerge
1.1设置
tikv:
coprocessor.split-region-on-table: false
1.2pd-ctl设置
pd-ctl config set max-merge-region-size 20
pd-ctl config set max-merge-region-keys 200000
pd-ctl config set merge-schedule-limit 8
//该参数不调整不会触发调整,原理未知
config set max-pending-peer-count 64
然后适当调小了部分参数,参数如下,具体是哪个参数起了效果…未知,反正现在是正常了
{
“replication”: {
“enable-placement-rules”: “true”,
“isolation-level”: “”,
“location-labels”: “”,
“max-replicas”: 3,
“strictly-match-label”: “false”
},
“schedule”: {
“enable-cross-table-merge”: “true”,
“enable-joint-consensus”: “true”,
“high-space-ratio”: 0.7,
“hot-region-cache-hits-threshold”: 3,
“hot-region-schedule-limit”: 4,
“leader-schedule-limit”: 16,
“leader-schedule-policy”: “count”,
“low-space-ratio”: 0.8,
“max-merge-region-keys”: 200000,
“max-merge-region-size”: 20,
“max-pending-peer-count”: 64,
“max-snapshot-count”: 16,
“max-store-down-time”: “30m0s”,
“merge-schedule-limit”: 8,
“patrol-region-interval”: “100ms”,
“region-schedule-limit”: 16,
“region-score-formula-version”: “v2”,
“replica-schedule-limit”: 16,
“split-merge-interval”: “1h0m0s”,
“tolerant-size-ratio”: 0
}
}