Questions about Resource Control Features in Version 7.1

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

Original topic: 关于v7.1版本资源管控特性的疑问

| username: Ming

[TiDB Usage Environment] Testing
[TiDB Version] v7.1.0
[Reproduction Path] Single statement with hint using resource control feature
[Encountered Issue: Problem Phenomenon and Impact]
There are currently two situations occurring:
Situation 1:
With RU set to 1, I have a select statement that originally exceeds memory. After binding the hint, it still reports an error of exceeding memory size and execution fails.
Situation 2:
With RU set to 1, I have a select statement that originally exceeds memory. After binding the hint, it reports an error of Exceeded resource group quota limitation.
Dear experts, I would like to understand why these two situations occur. Also, how should the control of a single SQL be understood? Should it be killed when exceeding the RU limit, or should it execute slowly with the highest bound RU?
[Attachment: Screenshot/Log/Monitoring]
Situation 1 Screenshot:


Situation 2 Screenshot:

| username: 我是咖啡哥 | Original post link

Are you asking why the two prompts are different? I think it might be because the first SQL triggered a limitation at the TiDB layer, while the second one triggered something at the TiKV layer. Hence, the prompts are different.

The TiDB resource control feature provides two levels of resource management capabilities, including flow control at the TiDB layer and priority scheduling at the TiKV layer.

| username: Ming | Original post link

Sorry, the description is not very comprehensive. Neither of the two statements has a priority set; both are using the default settings. Each time they are executed, only the corresponding single statement is run, with no other operations.

As for triggering TiDB flow control, I’m not sure if that’s the case, but even if it is triggered, it shouldn’t result in an out-of-memory error. A more reasonable outcome would be either exceeding the RU limit or slow execution (not sure which one specifically). This error seems more like a hint failure error (I didn’t pay attention to whether the hint was effective at the time, I forgot :smiling_face_with_tear:).

For the second statement, since it’s the only statement being executed and there are no other operations, it shouldn’t involve priority scheduling issues.

| username: li_zhenhuan | Original post link

You can refer to the section on Bad SQL throttling in this article.

| username: Ming | Original post link

Hello, teacher. I have two questions to confirm, thank you.

  1. So, if the RU limit is set for a single SQL using a hint, as long as the debt does not reach 30 times the current version, it will not report an error, right?
  2. Normally, after obtaining the region point information for a SQL process, is there only one RPC request for the same TiKV using the batch method? If the SQL is bound to RU, will it be executed serially multiple times?
| username: li_zhenhuan | Original post link

  1. So, if the hint method is used to impose RU restrictions on a single SQL, as long as the debt does not reach 30 times the current version, it will not report an error, right?
    Yes, it will not report an error if it does not exceed 30 times.

  2. Normally, after obtaining the region point information for a SQL process, is there only one RPC request for the same TiKV using the batch method? If it is a SQL bound with RU, will it be executed serially multiple times?
    A complex AP SQL may have multiple operators requesting TiKV multiple times. A single operator makes concurrent batch requests to multiple regions. Before the second operator starts executing, it will count the RU consumed by the first operator and trigger flow control if necessary. Normally, OLTP SQL generally involves one TiKV request, and at this time, multiple SQLs will also form concurrent requests and RU control.

| username: Ming | Original post link

Okay, thank you, teacher, for answering my questions.

| username: system | Original post link

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