版本4.0.8
TiFlash节点数据导入很慢,基本上1分钟2region的速度,是我们的配置需要优化吗,现在已经参考文档有调整了,但是似乎没什么用
执行的语句
ALTER TABLE summary_register SET TIFLASH REPLICA 1;
ALTER TABLE summary_register_day SET TIFLASH REPLICA 1;
截取了5分钟前后的日志
2020-11-25 13:16:48,898 TiFlashManager: report to tidb: id 16593, region_count 85, flash_region_count 54
2020-11-25 13:16:53,822 TiFlashManager: report to tidb: id 16016, region_count 4850, flash_region_count 1839
2020-11-25 13:16:53,844 TiFlashManager: report to tidb: id 16593, region_count 85, flash_region_count 54
2020-11-25 13:16:58,824 TiFlashManager: report to tidb: id 16593, region_count 85, flash_region_count 54
2020-11-25 13:16:58,857 TiFlashManager: report to tidb: id 16016, region_count 4850, flash_region_count 1839
2020-11-25 13:17:03,827 TiFlashManager: report to tidb: id 16016, region_count 4850, flash_region_count 1839
2020-11-25 13:17:03,849 TiFlashManager: report to tidb: id 16593, region_count 85, flash_region_count 54
2020-11-25 13:17:08,842 TiFlashManager: report to tidb: id 16016, region_count 4850, flash_region_count 1839
2020-11-25 13:17:08,862 TiFlashManager: report to tidb: id 16593, region_count 85, flash_region_count 54
2020-11-25 13:17:14,032 TiFlashManager: report to tidb: id 16593, region_count 85, flash_region_count 54
2020-11-25 13:17:14,066 TiFlashManager: report to tidb: id 16016, region_count 4850, flash_region_count 1839
2020-11-25 13:17:18,808 TiFlashManager: report to tidb: id 16593, region_count 85, flash_region_count 54
2020-11-25 13:17:18,842 TiFlashManager: report to tidb: id 16016, region_count 4850, flash_region_count 1839
2020-11-25 13:20:33,846 TiFlashManager: report to tidb: id 16593, region_count 85, flash_region_count 60
2020-11-25 13:20:38,800 TiFlashManager: report to tidb: id 16016, region_count 4850, flash_region_count 1849
2020-11-25 13:20:38,822 TiFlashManager: report to tidb: id 16593, region_count 85, flash_region_count 60
2020-11-25 13:20:43,832 TiFlashManager: report to tidb: id 16016, region_count 4850, flash_region_count 1849
2020-11-25 13:20:43,855 TiFlashManager: report to tidb: id 16593, region_count 85, flash_region_count 60
2020-11-25 13:20:48,877 TiFlashManager: report to tidb: id 16016, region_count 4850, flash_region_count 1849
2020-11-25 13:20:48,899 TiFlashManager: report to tidb: id 16593, region_count 85, flash_region_count 60
2020-11-25 13:20:53,831 TiFlashManager: report to tidb: id 16016, region_count 4850, flash_region_count 1849
2020-11-25 13:20:53,853 TiFlashManager: report to tidb: id 16593, region_count 85, flash_region_count 60
2020-11-25 13:20:58,806 TiFlashManager: report to tidb: id 16593, region_count 85, flash_region_count 60
2020-11-25 13:20:58,842 TiFlashManager: report to tidb: id 16016, region_count 4850, flash_region_count 1849
2020-11-25 13:21:03,846 TiFlashManager: report to tidb: id 16016, region_count 4850, flash_region_count 1849
2020-11-25 13:21:03,869 TiFlashManager: report to tidb: id 16593, region_count 85, flash_region_count 60
2020-11-25 13:21:08,844 TiFlashManager: report to tidb: id 16016, region_count 4850, flash_region_count 1849
2020-11-25 13:21:08,866 TiFlashManager: report to tidb: id 16593, region_count 85, flash_region_count 60
2020-11-25 13:21:13,828 TiFlashManager: report to tidb: id 16016, region_count 4850, flash_region_count 1849
2020-11-25 13:21:13,849 TiFlashManager: report to tidb: id 16593, region_count 85, flash_region_count 60
2020-11-25 13:21:18,819 TiFlashManager: report to tidb: id 16016, region_count 4850, flash_region_count 1849
2020-11-25 13:21:18,840 TiFlashManager: report to tidb: id 16593, region_count 85, flash_region_count 60
2020-11-25 13:21:23,833 TiFlashManager: report to tidb: id 16016, region_count 4850, flash_region_count 1849
2020-11-25 13:21:23,856 TiFlashManager: report to tidb: id 16593, region_count 85, flash_region_count 60
2020-11-25 13:21:28,829 TiFlashManager: report to tidb: id 16016, region_count 4850, flash_region_count 1849
配置 config show all
{
"client-urls": "http://0.0.0.0:2379",
"peer-urls": "http://10.155.111.139:2380",
"advertise-client-urls": "http://10.155.111.139:2379",
"advertise-peer-urls": "http://10.155.111.139:2380",
"name": "pd_10.155.111.139",
"data-dir": "/home/tidb/deploy/data.pd",
"force-new-cluster": false,
"enable-grpc-gateway": true,
"initial-cluster": "pd_10.155.111.139=http://10.155.111.139:2380,pd_52-136=http://10.155.111.136:2380,pd_10.155.111.236=http://10.155.111.236:2380",
"initial-cluster-state": "new",
"initial-cluster-token": "pd-cluster",
"join": "",
"lease": 3,
"log": {
"level": "info",
"format": "text",
"disable-timestamp": false,
"file": {
"filename": "/home/tidb/deploy/log/pd.log",
"max-size": 300,
"max-days": 0,
"max-backups": 0
},
"development": false,
"disable-caller": false,
"disable-stacktrace": false,
"disable-error-verbose": true,
"sampling": null
},
"tso-save-interval": "3s",
"metric": {
"job": "pd_10.155.111.139",
"address": "",
"interval": "15s"
},
"schedule": {
"max-snapshot-count": 3,
"max-pending-peer-count": 64,
"max-merge-region-size": 20,
"max-merge-region-keys": 200000,
"split-merge-interval": "1h0m0s",
"enable-one-way-merge": "false",
"enable-cross-table-merge": "false",
"patrol-region-interval": "100ms",
"max-store-down-time": "1h0m0s",
"leader-schedule-limit": 1,
"leader-schedule-policy": "count",
"region-schedule-limit": 1024,
"replica-schedule-limit": 4,
"merge-schedule-limit": 8,
"hot-region-schedule-limit": 2,
"hot-region-cache-hits-threshold": 3,
"store-limit": {
"20847613": {
"add-peer": 30,
"remove-peer": 30
},
"20847615": {
"add-peer": 30,
"remove-peer": 30
},
"22290001": {
"add-peer": 30,
"remove-peer": 30
},
"23684702": {
"add-peer": 4096,
"remove-peer": 4096
}
},
"tolerant-size-ratio": 5,
"low-space-ratio": 0.8,
"high-space-ratio": 0.6,
"scheduler-max-waiting-operator": 3,
"enable-remove-down-replica": "true",
"enable-replace-offline-replica": "true",
"enable-make-up-replica": "true",
"enable-remove-extra-replica": "true",
"enable-location-replacement": "true",
"enable-debug-metrics": "false",
"schedulers-v2": [
{
"type": "balance-region",
"args": null,
"disable": false,
"args-payload": ""
},
{
"type": "balance-leader",
"args": null,
"disable": false,
"args-payload": ""
},
{
"type": "hot-region",
"args": null,
"disable": false,
"args-payload": ""
},
{
"type": "label",
"args": null,
"disable": false,
"args-payload": ""
}
],
"schedulers-payload": {
"balance-hot-region-scheduler": null,
"balance-leader-scheduler": {
"name": "balance-leader-scheduler",
"ranges": [
{
"end-key": "",
"start-key": ""
}
]
},
"balance-region-scheduler": {
"name": "balance-region-scheduler",
"ranges": [
{
"end-key": "",
"start-key": ""
}
]
},
"label-scheduler": {
"name": "label-scheduler",
"ranges": [
{
"end-key": "",
"start-key": ""
}
]
}
},
"store-limit-mode": "manual"
},
"replication": {
"max-replicas": 3,
"location-labels": "",
"strictly-match-label": "false",
"enable-placement-rules": "true"
},
"pd-server": {
"use-region-storage": "true",
"max-gap-reset-ts": "24h0m0s",
"key-type": "table",
"runtime-services": "",
"metric-storage": "http://10.155.111.136:9090",
"dashboard-address": "http://10.155.111.136:2379",
"trace-region-flow": "true"
},
"cluster-version": "4.0.8",
"quota-backend-bytes": "8GiB",
"auto-compaction-mode": "periodic",
"auto-compaction-retention-v2": "1h",
"TickInterval": "500ms",
"ElectionInterval": "3s",
"PreVote": true,
"security": {
"cacert-path": "",
"cert-path": "",
"key-path": "",
"cert-allowed-cn": null
},
"label-property": {},
"WarningMsgs": [
"disable-telemetry in conf/pd.toml is deprecated, use enable-telemetry instead"
],
"DisableStrictReconfigCheck": false,
"HeartbeatStreamBindInterval": "1m0s",
"LeaderPriorityCheckInterval": "1m0s",
"dashboard": {
"tidb-cacert-path": "",
"tidb-cert-path": "",
"tidb-key-path": "",
"public-path-prefix": "/dashboard",
"internal-proxy": false,
"enable-telemetry": true,
"enable-experimental": false
},
"replication-mode": {
"replication-mode": "majority",
"dr-auto-sync": {
"label-key": "",
"primary": "",
"dr": "",
"primary-replicas": 0,
"dr-replicas": 0,
"wait-store-timeout": "1m0s",
"wait-sync-timeout": "1m0s"
}
}
}