-
Notifications
You must be signed in to change notification settings - Fork 3.6k
PIP 93: Transaction performance tools
congbo edited this page Sep 18, 2021
·
5 revisions
- Status: Proposal
- Authors: Xiangying Meng、Bo Cong
- Pull Request:
- Mailing List discussion:
- Release:
Now, transaction basic development has been completed. The user must test the performance of the transaction before using the transaction. Developers also need to test the transaction to ensure that the performance of the transaction meets the needs of the production environment.
What we need to do is create or update perf test tools to test the performance of the transaction component.
- test performance of
transactionBuffer
:- compare the performance difference between sending messages with transaction and without transaction.
- test performance of
PendingAck
:- compare the performance difference with transaction and without transaction ack message
- test performance of
TransactionCoordinator
- compare the ack and produce performance difference with transaction and without transaction.
- test the performance of service handle transaction ops.
We implemented the performance tests of the three components of transaction separately.
- update
PerformanceProducer
———testTransactionBuffer
- Add
isTransactionEnable
to control whether transactions need to be opened. - Add
numMessagesPerTransaction
to control the number messages of a transaction produced
- Add
- update
PerformanceConsumer
———testPendingAckHnadler
- Add
isTransactionEnable
to control whether transactions need to be opened. - Add
numMessagesPerTransaction
to control the number messages of a transaction ack.
- Add
- add
PerformanceTransaction
. ———testTransactionCoordinator
-
numTestThreads
We can create a ThreadPool with a fixed number of threads and use it to run normal transaction flow. When the number of messages produced and consumed in the transaction is small, the transaction will be frequently created and terminated, which is executed by transactionCoordinator. Every thread we will create a producer and consumer to produce or consume specified topic. Try to reduce the impact of client-side production and consumption on transaction op(CommandNewTxn
,CommandAddPartitionToTxn
etc.) - Add
isTrasnactionEnable
to control whether transactions need to be opened. -
PerformanceTransaction
don't handle complexity logic of produce or consume and focus on the performance test of transaction coordinator. so we don't need to care about message size etc. If you want to testPendingAck
orTransactionBuffer
, you can usePerformanceProducer
orPerformanceConsumer
and enable transaction.
-
-
isCommitedTransaction
= true; -
isEnableTransaction
= false; when this option is true, we will do any op with transaction. - public int
numMessagesPerTransaction
= 1; this num is how many messages to produce or consume per transaction. - public long
transactionTimeout
= 5; transaction timeout time.
- public long numTransactions = 0;
- the number of transaction, if 0, it will keep opening
- Basic configuration
- boolean help;
- public List<String> consumeTopics = Collections.singletonList("sub");
- public List<String> produceTopics = Collections.singletonList("test");
- private SubscriptionInitialPosition subscriptionInitialPosition = SubscriptionInitialPosition.Latest;
- public String confFile;
- public SubscriptionType subscriptionType = SubscriptionType.Exclusive;
- public int numThreads = 1;
- public String adminURL;
- public String serviceURL;
- public Integer partitions = null;
- public int maxConnections = 100;
- public long testTime = 0;
- public int ioThreads = 1;
- public List<String> subscriptions = Collections.singletonList("sub");
- public int numSubscriptions = 1;
- public int openTxnRate = 0;