Parameter Configuration for Mixed Deployment of TiKV and TiDB

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: TiKV和TiDB混合部署的参数配置

| username: 花匠小林

[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]

| username: Kongdom | Original post link

Refer to this link:

| username: Kongdom | Original post link

:handshake: :handshake: :handshake:
Although it’s not recommended to deploy TiDB and TiKV together, it’s best for TiKV to be independent. TiDB can be deployed together with PD.

| username: Kongdom | Original post link

The image is not visible. Please provide the text you need translated.

| username: 花匠小林 | Original post link

Indeed, I can’t get the resources. :sob:

| username: Fly-bird | Original post link

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"
| username: Kongdom | Original post link

:+1: Hands-on user!

| username: Fly-bird | Original post link

There is a small production environment currently deployed on a single machine. The data volume is small, so it doesn’t affect anything.

| username: Fly-bird | Original post link

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.

| username: Kongdom | Original post link

Indeed, high availability is not a concern for a single machine. However, to be fair, MySQL performs slightly better on a single machine.

| username: 花匠小林 | Original post link

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.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.