TiDB Performance Issues

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

Original topic: TIDB性能问题

| username: 每天当牛马

Is there a report comparing the performance of a single-node TiDB cluster deployment with MySQL?

| username: Fly-bird | Original post link

TiDB on a single machine can’t outperform MySQL; you can test it yourself.

| username: 每天当牛马 | Original post link

Is there any official conclusion or report? The test results show a difference of 3-4 times, and I need to report it.

| username: 每天当牛马 | Original post link

Or should I deploy multiple TiKV instances on a single server? Would that be useful?

| username: 春风十里 | Original post link

A single machine can’t outperform MySQL. I remember someone in the community did an experiment on this.

| username: zhanggame1 | Original post link

Unless you have multiple NVMe physical drives, with each TiKV pointing to a separate physical drive, the speed will significantly improve.

| username: 小龙虾爱大龙虾 | Original post link

By design, TiDB is not meant to run on a single machine, so this comparison is meaningless.

| username: 路在何chu | Original post link

There’s no need to compare, it’s meaningless. TiDB on a single machine definitely can’t compete with MySQL.

| username: 江湖故人 | Original post link

Comparing single machines is not very meaningful. You can refer to the image below:
image
TiDB VS MySQL Performance - Alibaba Cloud Developer Community (aliyun.com)

| username: linnana | Original post link

Single-node deployment is generally used for testing functionality.

| username: Kongdom | Original post link

:yum: If you can only compare on a single machine, it is recommended to deploy TiDB on a single node and then test after the data volume of a single table rises to over hundreds of millions. With small data volumes, MySQL will definitely have the advantage.

| username: 每天当牛马 | Original post link

The current usage scenario involves 210,000 data tables, with only a few rows of data per table. Previously, MySQL was used, but now we are adapting to the TiDB database for localization. The deployment method is to deploy each component on a single server. The current test conclusion is that the performance is significantly worse than MySQL. I would like to see if there are any official conclusions.

| username: Kongdom | Original post link

:flushed: For tables with only a few rows of data, you can try small table caching.

However, given your description, it seems like using Redis might be better since each table only has a few rows of data.

| username: 每天当牛马 | Original post link

Currently, I have deployed TiDB on a single server, and it takes about 180ms to create a single table. The same table in MySQL only takes 20ms. Is this difference normal, and is there any way to improve the table creation speed?

| username: zhanggame1 | Original post link

How many TiKVs do you have? Try deploying just one on a single machine.

| username: Kongdom | Original post link

:flushed: Can I ask about the server configuration? Additionally, I suggest deploying a single instance with 1 TiDB, 1 PD, and 1 TiKV.

| username: 每天当牛马 | Original post link

Server performance: 24 cores, 48 threads

| username: 每天当牛马 | Original post link

Currently, it is deployed like this.

| username: zhanggame1 | Original post link

Executing a single SQL in a distributed system is definitely slower than on a single machine, as each component needs to go through network calls.

| username: 每天当牛马 | Original post link

Are there any optimization solutions? Currently, only a single server is allowed, and the time difference compared to MySQL table creation is too large. Are there any configuration changes that can improve this speed?