How to Adjust the Parameters txn-entry-size-limit and raft-entry-max-size

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

Original topic: txn-entry-size-limit 和 raft-entry-max-size 这两个参数具体怎么调整

| username: yulei7633

The parameters txn-entry-size-limit and raft-entry-max-size are currently a bit small and need to be doubled. How can these two parameters be adjusted simultaneously?
The current configuration in the cluster is: txn-entry-size-limit: 120M, raft-entry-max-size: 8M, txn-total-size-limit: 100M, max_allowed_packet: 64M.
The cluster frequently reports the following error: “raft entry is too large, region 28183, entry size 162” raft_entry_too_large:<region_id:28183 entry_size:162>.
I want to modify the corresponding parameters in the cluster and increase them appropriately. How should the sizes be adjusted, and is there a proportional relationship between the various parameters?

| username: 像风一样的男子 | Original post link

Use tiup cluster edit-config ${cluster-name} to modify the cluster configuration,
then execute the reload command to distribute the configuration and restart the corresponding components:
tiup cluster reload tidb-feng [-N <nodes>] [-R <roles>]

| username: Kongdom | Original post link

I don’t think it can be doubled. For example, in your screenshot, the default value is 64M, and the maximum supported is 120M. If you want to double it, it would be 128M, which exceeds the maximum value. The value of txn-entry-size-limit needs to be increased along with max_allowed_packet and txn-total-size-limit.

For instance, if txn-entry-size-limit is increased to 120M, you need to adjust max_allowed_packet to be greater than 120M and txn-total-size-limit to be greater than 120M as well.

| username: Soysauce520 | Original post link

After editing the configurations, the modifications are as follows:
server_configs:
tidb:
performance.txn-entry-size-limit: 12582912
tikv:
raftstore.raft-entry-max-size: 16MB

| username: yulei7633 | Original post link

I would like to ask, for the three parameters mentioned above, what specific sizes should be modified? How should they be allocated?

| username: TiDBer_小阿飞 | Original post link

txn-entry-size-limit: 120M, raft-entry-max-size: 8M, txn-total-size-limit: 100M
txn-entry-size-limit: Limit on the size of a single key-value in a transaction
raft-entry-max-size: Maximum size of a single raft write
txn-total-size-limit: Size limit of a single transaction in TiDB

Obviously, txn-total-size-limit must be greater than txn-entry-size-limit, which means a single transaction includes the key-value in the transaction. If you set txn-entry-size-limit to 120MB and txn-total-size-limit to 100MB, won’t it cause an error?

| username: heiwandou | Original post link

For a single transaction, both KV limits need to be configured.

| username: yulei7633 | Original post link

There are indeed issues with the configuration of these parameters in the cluster. Currently, it is still in the testing phase, so I am consulting everyone by posting this question.

Here are the parameter configurations I have organized so far:

server_configs:
  tidb:
    performance.txn-entry-size-limit: 33554432
  tikv:
    raftstore.raft-entry-max-size: 30MiB
    server.max-grpc-send-msg-len: 41943040
  tiflash:
    raftstore-proxy.raftstore.raft-entry-max-size: 30MiB
    raftstore-proxy.server.max-grpc-send-msg-len: 41943040
| username: yulei7633 | Original post link

Currently, it is modified to around 30M, and the other parameters are sufficient.

| username: TiDBer_小阿飞 | Original post link

I feel that the other two parameters are related to the region, while raft-entry-max-size is related to raft.

| username: yulei7633 | Original post link

This parameter configuration has been consulted with official personnel. It is relatively reliable.

| username: system | Original post link

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