Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize: Add TM, RM channel fail fast config #762

Merged
merged 2 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ transport.enable-client-batch-send-request、client.log.exceptionRate
| seata.enableAutoDataSourceProxy=true | whether to enable automatic proxy of data source | True, false, data spring boot starter (SSBS) is a special configuration. SSBS will enable automatic proxy of data source by default and can be closed through this configuration item|
| seata.useJdkProxy=false | whether to use JDK proxy as the implementation method of data source automatic proxy | true, false, (SSBS) proprietary configuration, false by default, CGLIB as the implementation method of data source automatic proxy|
| transport.enableClientBatchSendRequest | whether to batch merge and send client transaction message requests | The default is true and false|
| transport.enableTmClientChannelCheckFailFast | TM client channel check fail fast | The default is true. true is check, false is not check|
| transport.enableRmClientChannelCheckFailFast | RM client channel check fail fast | The default is true. true is check, false is not check|
| client.log.exceptionRate | log exception output probability | 100 by default, currently used for exception stack output in case of undo rollback failure, 1% probability output, rollback failure is basically dirty data, no need to output stack to occupy hard disk space|
| service.vgroupMapping.my_test_tx_Group | transaction group (Appendix 1) | my_ test_ tx_ Group refers to grouping, and the configuration item value is TC cluster name|
| service.default.grouplist | TC service list (Appendix 2) | Only used when the registry is file|
Expand Down Expand Up @@ -409,4 +411,4 @@ On the contrary, if the current distributed transaction is closed, the self-test

In the store mode=db. Because seata inserts global locks in batches through the executeBatch of jdbc, according to the MySQL official website, when the rewriteBatchedStatements in the connection parameter is true, when executeBatch is executed and the operation type is insert, the jdbc driver will optimize the corresponding SQL to the form of 'insert into () values (), ()' to improve the performance of batch insert.

According to the actual test, when this parameter is set to true, the corresponding batch insert performance is more than 10 times of the original. Therefore, it is recommended to set this parameter to true when the data source is MySQL.
According to the actual test, when this parameter is set to true, the corresponding batch insert performance is more than 10 times of the original. Therefore, it is recommended to set this parameter to true when the data source is MySQL.
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ description: Seata 参数配置。
| seata.enableAutoDataSourceProxy=true | 是否开启数据源自动代理 | true、false,seata-spring-boot-starter(SSBS)专有配置,SSBS默认会开启数据源自动代理,可通过该配置项关闭.|
| seata.useJdkProxy=false | 是否使用JDK代理作为数据源自动代理的实现方式| true、false,(SSBS)专有配置,默认false,采用CGLIB作为数据源自动代理的实现方式 |
| transport.enableClientBatchSendRequest | 客户端事务消息请求是否批量合并发送 |默认true,false单条发送 |
| transport.enableTmClientChannelCheckFailFast | 客户端TM快速失败检查 |默认true,false不检测 |
| transport.enableRmClientChannelCheckFailFast | 客户端RM快速失败检查 |默认true,false不检测 |
| client.log.exceptionRate | 日志异常输出概率 | 默认100,目前用于undo回滚失败时异常堆栈输出,百分之一的概率输出,回滚失败基本是脏数据,无需输出堆栈占用硬盘空间 |
| service.vgroupMapping.my_test_tx_group | 事务群组(附录1) |my_test_tx_group为分组,配置项值为TC集群名 |
| service.default.grouplist | TC服务列表(附录2) | 仅注册中心为file时使用 |
Expand Down Expand Up @@ -307,4 +309,4 @@ sh ${SEATAPATH}/script/config-center/zk/zk-config.sh -h localhost -p 2181 -z "/U

### 附录7:
在store.mode=db,由于seata是通过jdbc的executeBatch来批量插入全局锁的,根据MySQL官网的说明,连接参数中的rewriteBatchedStatements为true时,在执行executeBatch,并且操作类型为insert时,jdbc驱动会把对应的SQL优化成`insert into () values (), ()`的形式来提升批量插入的性能。
根据实际的测试,该参数设置为true后,对应的批量插入性能为原来的10倍多,因此在数据源为MySQL时,建议把该参数设置为true。
根据实际的测试,该参数设置为true后,对应的批量插入性能为原来的10倍多,因此在数据源为MySQL时,建议把该参数设置为true。
Loading