-
Notifications
You must be signed in to change notification settings - Fork 10
[Performance Test] Add Test Clients for Apache RocketMQ on Dockers #39
base: master
Are you sure you want to change the base?
Conversation
Test for different number of topics,producers and consumers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some early feedback. Thank you for your contribution.
| @Override | ||
| public void run(){ | ||
| try { | ||
| //设置生产者组名 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lly00 I do understand the comments :-) As this repository is a public repo, in order to be accessed by a broader community, I would recommend to replace the comments in English. Thank you.
tools/rocketmq-test/client/pom.xml
Outdated
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE:This comment is not for pom.xml
Please remove the target folder in the PR as it is auto-generated. Instead, you can create a .gitignore file which could avoid checking any files or directories that you don't want to check in.
An example: https://github.com/futurewei-cloud/alcor/blob/master/.gitignore
| @@ -0,0 +1,142 @@ | |||
| #!/bin/bash | |||
|
|
|||
| # Licensed to the Apache Software Foundation (ASF) under one or more | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick question: do we modify some existing scripts which are under ASF license? Could you add the source script link as the beginning of this file as well? Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add some comments, focus on the perf, also please remove binary files
| String temp_str = new String(temp); | ||
| return temp_str; | ||
| } | ||
| // private static void startConsumer(String topicName) throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove commented code
| int consumerThreadCount = 20; | ||
| int topicNumber = 20; | ||
|
|
||
| String url = "localhost:9876"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make it read from central config
| System.out.println(topicName + " " + "Start produce"); | ||
| while (true) { | ||
| Message message = new Message(topicName,"TagTest",createSpecificSizeString(size).getBytes()); | ||
| long startTime = System.currentTimeMillis(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please log thread info
| producer.send(message); | ||
| long endTime = System.currentTimeMillis(); | ||
| System.out.println(topicName + " " + "send message in %d",endTime-startTime); | ||
| Thread.sleep(1000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why wait here?
| @@ -0,0 +1,7 @@ | |||
| /home/sdn02/rocketmq/Client/src/main/java/demo/ProducerThreadPool.java | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make one home env instead of hard coding path
| # limitations under the License. | ||
| # | ||
|
|
||
| FROM centos:7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please merge Docker ops when possible to speed up and save layers
| # Set for `JAVA_OPT`. | ||
| JAVA_OPT="${JAVA_OPT} -server -Xms${Xms} -Xmx${Xmx} -Xmn${Xmn}" | ||
| JAVA_OPT="${JAVA_OPT} -XX:+UseG1GC -XX:G1HeapRegionSize=16m -XX:G1ReservePercent=25 -XX:InitiatingHeapOccupancyPercent=30 -XX:SoftRefLRUPolicyMSPerMB=0 -XX:SurvivorRatio=8" | ||
| JAVA_OPT="${JAVA_OPT} -verbose:gc -Xloggc:/dev/shm/mq_gc_%p.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCApplicationStoppedTime -XX:+PrintAdaptiveSizePolicy" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need verbose:gc here before we hit problem, which would slow down the perf
| #=========================================================================================== | ||
| calculate_heap_sizes() | ||
| { | ||
| case "`uname`" in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good!
| consumer.registerMessageListener(new MessageListenerConcurrently() { | ||
| @Override | ||
| public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> msgs, ConsumeConcurrentlyContext context) { | ||
| System.out.printf("%s Receive New Messages: %s %n", Thread.currentThread().getName(), msgs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need this msg , only the statistics
| defaultTopicQueueNums=4 | ||
|
|
||
| #是否允许 Broker 自动创建Topic,建议线下开启,线上关闭 !!!这里仔细看是false,false,false | ||
| #原因下篇博客见~ 哈哈哈哈 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what 's 哈哈哈哈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let us move those comments completely from the PR. @lly00
|
@lly00 Thanks for uploading the test results 👍 @chenpiaoping This is also related to the MQ scaling path perf testing. |
test rocketmq with different number of topics,producers and consumers.