Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: TiKV和TiDB混合部署的参数配置
[Test Environment for TiDB]
[TiDB Version] v7.1.1
[Reproduction Path] None
[Encountered Issues: Problem Phenomenon and Impact]
During testing, there were several instances where the server froze due to insufficient memory/CPU overload. The deployment is as shown in the image (TiKV and TiDB are deployed on the same server). We are currently working on resolving slow query issues, but I would like to ask if there are any configuration limits on the memory and CPU usage for TiKV and TiDB to prevent the server from freezing.
[Resource Configuration]
[Attachments: Screenshots/Logs/Monitoring]
The image is not visible. Please provide the text you need translated.
Indeed, I can’t get the resources. 
A machine with 4 cores and 8GB of RAM can handle a mixed deployment without issues if the data volume is not large. Modify the deployment configuration file toml as follows:
global:
user: "tidb"
ssh_port: 22
deploy_dir: "/data/tidb-deploy"
data_dir: "/data/tidb-data"
arch: "amd64"
monitored:
node_exporter_port: 9100
blackbox_exporter_port: 9115
deploy_dir: "/data/tidb-deploy/monitored-9100"
data_dir: "/data/tidb-data/monitored-9100"
log_dir: "/data/tidb-deploy/monitored-9100/log"
server_configs:
tidb:
log.slow-threshold: 300
binlog.enable: false
binlog.ignore-error: false
tikv:
readpool.storage.use-unified-pool: false
readpool.coprocessor.use-unified-pool: true
pd:
schedule.leader-schedule-limit: 4
schedule.region-schedule-limit: 2048
schedule.replica-schedule-limit: 64
pd_servers:
- host: 10.10.40.85
ssh_port: 22
name: "pd-1"
client_port: 2379
peer_port: 2380
deploy_dir: "/data/tidb-deploy/pd-2379"
data_dir: "/data/tidb-data/pd-2379"
log_dir: "/data/tidb-deploy/pd-2379/log"
tidb_servers:
- host: 10.10.40.85
ssh_port: 22
port: 4000
status_port: 10080
deploy_dir: "/data/tidb-deploy/tidb-4000"
log_dir: "/data/tidb-deploy/tidb-4000/log"
config:
log.slow-query-file: /data/tidb-slow-overwrited.log
tikv_servers:
- host: 10.10.40.85
ssh_port: 22
port: 20160
status_port: 20180
deploy_dir: "/data/tidb-deploy/tikv-20160"
data_dir: "/data/tidb-data/tikv-20160"
log_dir: "/data/tidb-deploy/tikv-20160/log"
monitoring_servers:
- host: 10.10.40.85
ssh_port: 22
port: 9090
deploy_dir: "/data/tidb-deploy/prometheus-8249"
data_dir: "/data/tidb-data/prometheus-8249"
log_dir: "/data/tidb-deploy/prometheus-8249/log"
grafana_servers:
- host: 10.10.40.85
port: 3000
deploy_dir: /data/tidb-deploy/grafana-3000
alertmanager_servers:
- host: 10.10.40.85
ssh_port: 22
web_port: 9093
cluster_port: 9094
deploy_dir: "/data/tidb-deploy/alertmanager-9093"
data_dir: "/data/tidb-data/alertmanager-9093"
log_dir: "/data/tidb-deploy/alertmanager-9093/log"
There is a small production environment currently deployed on a single machine. The data volume is small, so it doesn’t affect anything.
For a single server, don’t deploy 3 KV instances. Refer to my configuration and deploy just one KV instance. This will save a lot of resources and it can run smoothly.
Indeed, high availability is not a concern for a single machine. However, to be fair, MySQL performs slightly better on a single machine.
Currently, the data volume in the test environment is quite large. Several tables have 20 million records per day, but they are only kept for about 15 days.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.