Client Parameter Configuration
Purpose
You modify the client parameters to increase the test pressure. The client parameters are set when the kafka-perf tool is used to test the production and consumption scenarios, including the number of copies, data block size and number of messages.
Procedure
When using the Kafka-perf test tool to submit production or consumption commands, add the following parameters and set their values:
Parameter |
Recommended Value |
Description |
|---|---|---|
replication-factor |
2 |
This parameter specifies the number of copies of the production data. To ensure data reliability, the number of copies must be at least 2. It is a very risky operation to set the value of this parameter to 1. During the performance test, the number of copies is usually set to 2. |
record-size |
1024-65535 |
This parameter specifies the data block size. The data block size in actual scenarios is determined by specific services. Generally, the data block sizes of common services range from 1024 to 65535. Generally, at least five data block sizes are selected from this range for performance tests. The production and consumption performance varies depending on the data block size (The actual performance is related to the network packet size). |
num-fetch-threads |
Retain the default value. |
This parameter specifies the number of threads for pulling data, that is, the number of consumers. If network bottleneck exists, adjusting this parameter has little effect. |
threads |
Retain the default value. |
This parameter specifies the number of consumption processing threads. If network bottleneck exists, adjusting this parameter has little effect. |
messages |
800000000 |
This parameter specifies the number of consumed messages. The Kafka performance fluctuates during message consumption. Therefore, you need to perform test for different numbers of messages to decide what number of messages can achieve the highest performance. Generally, the value is about 800000000. |
request.required.acks |
0 |
This parameter specifies whether the brokers need to response after a message is sent. By default, the brokers need to respond. You can set it to 0, which may be helpful in scenarios where the data block size is small and messages are frequently sent. |
linger.ms |
0 |
This parameter specifies the delay for aggregating multiple messages. The default value is 0. Generally, retain the default value. |