Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 迁移到v6.5.5上遇到两个问题,不知同学们可遇到过
[TiDB Usage Environment] Production Environment
[TiDB Version]
[Reproduction Path] What operations were performed when the issue occurred
[Encountered Issues: Issue Phenomenon and Impact]
We just migrated from v5.3.0 to v6.5.5 in production and found that the speed is not as good as v5.3.0.
First issue: The same statement mostly performs a full table scan on TiFlash in v6, while in v5 it uses the TiKV index, which is more efficient than v6.
Second issue: My TiFlash configuration is only 16C/32G, is this too low? The official recommended configuration is 48C/128G, which is too high and costly. TiFlash often reports insufficient memory in the core. Are there any parameters that can be adjusted to control TiFlash’s memory access?
You can force it to only use TiKV.
Currently, this is how it’s done. What I’m curious about is why the same query often uses TiFlash in version 6, while in version 5 it would use TiKV.
Do not accelerate the entire database.
What is your current resource configuration?
In a situation where the data volume only increases and does not decrease, having too many machine configurations can also affect performance.
Currently, we are using Tencent S6 machines with 16 cores and 32GB of RAM. There are 5 TiFlash nodes and 4 TiKV nodes.
Let’s see if TiFlash can add more memory.
TiFlash has relatively high hardware resource requirements. If the configuration is not good, manually route to TiKV.
When upgrading the version, the same hardware configuration needs to be kept up. Otherwise, if the server determines that there are insufficient resources, it will affect the execution plan’s judgment, causing the issue you mentioned above.
Try not to use hardware that is below the official minimum requirements. TiDB is somewhat hardware-intensive. Otherwise, it will be difficult to troubleshoot various issues that may arise later on, and you won’t know whether it’s a machine problem, a configuration issue, or something else.
TiFlash requires a high CPU configuration. It is estimated that the situation will improve after the pipeline in version 7.5 becomes generally available.
Question 1: Is it possible that the optimizer of the version has been modified?
Question 2:
The memory cache size limit for data block metadata, usually does not need to be modified
mark_cache_size = 1073741824
The memory cache size limit for data block min-max index, usually does not need to be modified
minmax_index_cache_size = 1073741824
DeltaIndex memory cache size limit, default is 0, which means no limit
delta_index_cache_size = 0