What is the appropriate size for tidb's raftstore.apply-pool-size setting?

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

Original topic: tidb的raftstore.apply-pool-size设置多大合适?

| username: TiDBer_y9IRzLWc

[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version]
[Reproduction Path] What operations were performed when the issue occurred
[Encountered Issue: Issue Phenomenon and Impact]
[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachments: Screenshots / Logs / Monitoring]

The current online environment has slow data insertion. What is the appropriate setting for raftstore.apply-pool-size?

| username: tidb菜鸟一只 | Original post link

Have you confirmed that the slow data insertion is related to the apply-pool-size?

| username: Kongdom | Original post link

The default value of 2 should be fine.

| username: TiDBer_y9IRzLWc | Original post link

I read an optimization article, and the situation is the same as in this article. The article mentions that increasing the value of this parameter can help.
Common Ways to Handle Slow Writes in TiDB Database (qq.com)
This is the link, so I’m not sure and wanted to ask?

| username: tidb菜鸟一只 | Original post link

If the phenomenon is the same, you can modify it, but it is not recommended to make it too large, just between 1-5. You can use the following method:
SET config tikv raftstore.apply-pool-size=4;
After making the change, check if the issue is alleviated. If it is confirmed to be this issue, then modify the cluster configuration file through tiup cluster edit-config.

| username: redgame | Original post link

You can try increasing it and see how it works in practice.

| username: TiDBer_vfJBUcxl | Original post link

TiKV defaults the raftstore.store-pool-size configuration to 2. If there is a bottleneck in Raftstore, you can appropriately increase this parameter value based on the actual situation, but it is not recommended to set it too high to avoid unnecessary thread switching overhead.

| username: system | Original post link

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