TiKV 6.5.0 Version Memory Cannot Be Controlled to the Configured 5G and Can Reach 10G

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

Original topic: TiKV6.5.0版本内存根本控制不住配置的5G能够达到10G

| username: TiDBer_G64jJ9u8

[TiDB Usage Environment] Test/PoC
[TiDB Version] 6.5.0
[Reproduction Path] Normal deployment, running in a single-machine test environment
[Encountered Problem: Phenomenon and Impact] Unable to limit TIKV memory
[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachment: Screenshot/Log/Monitoring]
image

mysql> show config where type=‘tikv’ and name=‘storage.block-cache.capacity’;
±-----±---------------------------------------------------±-----------------------------±--------+
| Type | Instance | Name | Value |
±-----±---------------------------------------------------±-----------------------------±--------+
| tikv | basic-tikv-0.basic-tikv-peer.my-app.svc:20160 | storage.block-cache.capacity | 1000MiB |
±-----±---------------------------------------------------±-----------------------------±--------+
1 row in set (0.03 sec)

mysql> show config where type=‘tikv’ and name=‘memory-usage-limit’;
±-----±---------------------------------------------------±-------------------±--------+
| Type | Instance | Name | Value |
±-----±---------------------------------------------------±-------------------±--------+
| tikv | basic-tikv-0.basic-tikv-peer.my-app.svc:20160 | memory-usage-limit | 5000MiB |
±-----±---------------------------------------------------±-------------------±--------+
1 row in set (0.04 sec)

All other configurations are default values.

| username: Billmay表妹 | Original post link

If you limit a software that is originally 10GB to only 5GB, it might not work properly!

What is the configuration of your standalone machine?

| username: TiDBer_G64jJ9u8 | Original post link

It originally provided control over the TIKV memory size. In several other test environments, the memory usage is only 2-3GB.

| username: zhanggame1 | Original post link

I have been testing these two parameters for the past couple of days to see the results.

| username: h5n1 | Original post link

Try disabling the parameter resolved-ts.enable = false.

| username: dba远航 | Original post link

I’ll test it out too.

| username: TIDB-Learner | Original post link

From the operating system level, TiDB uses cgroup for resource limitation, right? If the memory limit is not working, is it because swap memory is enabled?

| username: zhanggame1 | Original post link

storage.block-cache.capacity 1G is too small, I don’t think it’s enough for TiKV to run.

| username: 春风十里 | Original post link

How is everyone’s testing going?

| username: TiDBer_G64jJ9u8 | Original post link

If there are no anomalies, the parameters might have taken effect. The uncontrollable issue definitely indicates other anomalies. And no one can respond. Sigh! The stability of TiDB is still questionable. I previously saw a survey on domestic databases, in which 80% of people chose to prioritize database stability.

| username: h5n1 | Original post link

Try the latest version of 6.5 or version 7.5.0.

| username: Jellybean | Original post link

The foundational environmental resources for running any software need to be guaranteed, and the specific resource configuration requirements are clearly stated on the official website.

If it’s a single-machine scenario with fewer than 50 million rows in a table, it’s recommended to use MySQL for handling it.

When your single table data exceeds 50 million rows, reaches hundreds of millions, or even 10 billion rows, and you require millisecond-level response for read and write requests, that’s the application scenario for TiDB.

Many people’s test environments have at least three physical machines with more than 128GB of memory.