Skip to content

Conversation

Yunyung
Copy link
Collaborator

@Yunyung Yunyung commented Aug 20, 2025

The record-size and throughput arguments don’t work in
TestRaftServer. The recordsPerSec and recordSize values are always
hard-coded.

  • Fix recordsPerSec and recordSize values hard-coded issue
  • Add "Required" description to command-line options to make it clear to
    users.

Reviewers: Chia-Ping Tsai chia7712@gmail.com

@github-actions github-actions bot added triage PRs from the community core Kafka Broker small Small PRs labels Aug 20, 2025
@Yunyung
Copy link
Collaborator Author

Yunyung commented Aug 20, 2025

Some benchmark for reference:

Default throughput and record-size

bin/test-kraft-server-start.sh --config config/kraft.properties --replica-directory-id b8tRS7h4TJ2Vt43Dp85v2A
...
Throughput (bytes/second): 445430.81, Latency (ms): 20.0 p75 26.0 p99 29.0 p999
Throughput (bytes/second): 1065534.70, Latency (ms): 20.0 p75 26.0 p99 27.0 p999
Throughput (bytes/second): 1540081.58, Latency (ms): 20.0 p75 26.0 p99 27.0 p999
Throughput (bytes/second): 1914122.07, Latency (ms): 20.0 p75 26.0 p99 27.0 p999

Throughput = 20000

bin/test-kraft-server-start.sh --config config/kraft.properties --replica-directory-id b8tRS7h4TJ2Vt43Dp85v2A --throughput 20000
...
Throughput (bytes/second): 8.53, Latency (ms): 29.0 p75 29.0 p99 29.0 p999
Throughput (bytes/second): 734822.26, Latency (ms): 20.0 p75 26.0 p99 34.0 p999
Throughput (bytes/second): 1283868.42, Latency (ms): 20.0 p75 26.0 p99 31.0 p999
Throughput (bytes/second): 1710625.79, Latency (ms): 20.0 p75 26.0 p99 27.0 p999
Throughput (bytes/second): 2051202.05, Latency (ms): 20.0 p75 26.0 p99 27.0 p999
Throughput (bytes/second): 2330801.78, Latency (ms): 20.0 p75 26.0 p99 27.0 p999
Throughput (bytes/second): 5120510.52, Latency (ms): 20.0 p75 26.0 p99 27.0 p999
Throughput (bytes/second): 5120510.57, Latency (ms): 20.0 p75 26.0 p99 27.0 p999
Throughput (bytes/second): 5120402.04, Latency (ms): 20.0 p75 26.0 p99 27.0 p999
Throughput (bytes/second): 5120397.13, Latency (ms): 20.0 p75 26.0 p99 27.0 p999

record-size = 512

bin/test-kraft-server-start.sh --config config/kraft.properties --replica-directory-id b8tRS7h4TJ2Vt43Dp85v2A --record-size 512
...
Throughput (bytes/second): 17.07, Latency (ms): 31.0 p75 31.0 p99 31.0 p999
Throughput (bytes/second): 366489.44, Latency (ms): 20.0 p75 26.0 p99 40.0 p999
Throughput (bytes/second): 640950.14, Latency (ms): 20.0 p75 26.0 p99 35.0 p999
Throughput (bytes/second): 854959.16, Latency (ms): 20.0 p75 26.0 p99 31.0 p999
Throughput (bytes/second): 1025596.13, Latency (ms): 20.0 p75 26.0 p99 27.0 p999
Throughput (bytes/second): 1165135.54, Latency (ms): 20.0 p75 26.0 p99 27.0 p999
Throughput (bytes/second): 2560561.89, Latency (ms): 20.0 p75 26.0 p99 27.0 p999
Throughput (bytes/second): 2560481.59, Latency (ms): 20.0 p75 26.0 p99 27.0 p999
Throughput (bytes/second): 2560357.61, Latency (ms): 20.0 p75 26.0 p99 27.0 p999

@Yunyung Yunyung changed the title the record-size and throughputarguments don't work in TestRaftServer KAFKA-19618: the record-size and throughputarguments don't work in TestRaftServer Aug 20, 2025
@@ -428,7 +428,7 @@ object TestRaftServer extends Logging {
}

private class TestRaftServerOptions(args: Array[String]) extends CommandDefaultOptions(args) {
val configOpt: OptionSpec[String] = parser.accepts("config", "Required configured file")
val configOpt: OptionSpec[String] = parser.accepts("config", "REQUIRED: The configured file")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please use CommandLineUtils.checkRequiredArgs to check the existence in this PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. Thanks.

Verification:

$ bin/test-kraft-server-start.sh
[2025-08-21 00:41:04,035] INFO Registered `kafka:type=kafka.Log4jController` MBean (kafka.utils.Log4jControllerRegistration$)
Standalone raft server for performance testing
Option                                  Description                           
------                                  -----------                           
--config <String: filename>             REQUIRED: The configured file         
--help                                  Print usage information.              
--record-size <Integer: size in bytes>  The size of each record (default: 256)
--replica-directory-id <String:         REQUIRED: The directory id of the     
  directory id>                           replica                             
--throughput <Integer: records/sec>     The number of records per second the  
                                          leader will write to the metadata   
                                          topic (default: 5000)               
--version                               Display Kafka version.                
$ bin/test-kraft-server-start.sh --config config/kraft.properties 
[2025-08-21 00:41:12,627] INFO Registered `kafka:type=kafka.Log4jController` MBean (kafka.utils.Log4jControllerRegistration$)
Missing required argument "[replica-directory-id]"
Option                                  Description                           
------                                  -----------                           
--config <String: filename>             REQUIRED: The configured file         
--help                                  Print usage information.              
--record-size <Integer: size in bytes>  The size of each record (default: 256)
--replica-directory-id <String:         REQUIRED: The directory id of the     
  directory id>                           replica                             
--throughput <Integer: records/sec>     The number of records per second the  
                                          leader will write to the metadata   
                                          topic (default: 5000)               
--version                               Display Kafka version.                
$ bin/test-kraft-server-start.sh --replica-directory-id b8tRS7h4TJ2Vt43Dp85v2A
[2025-08-21 00:41:22,486] INFO Registered `kafka:type=kafka.Log4jController` MBean (kafka.utils.Log4jControllerRegistration$)
Missing required argument "[config]"
Option                                  Description                           
------                                  -----------                           
--config <String: filename>             REQUIRED: The configured file         
--help                                  Print usage information.              
--record-size <Integer: size in bytes>  The size of each record (default: 256)
--replica-directory-id <String:         REQUIRED: The directory id of the     
  directory id>                           replica                             
--throughput <Integer: records/sec>     The number of records per second the  
                                          leader will write to the metadata   
                                          topic (default: 5000)               
--version                               Display Kafka version. 

@github-actions github-actions bot removed the triage PRs from the community label Aug 21, 2025
@chia7712 chia7712 merged commit eeb6a0d into apache:trunk Aug 21, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Kafka Broker small Small PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants