Skip to content
This repository was archived by the owner on Mar 31, 2023. It is now read-only.

Conversation

luyaoluo
Copy link

test rocketmq with different number of topics,producers and consumers.

luyaoluo added 2 commits June 16, 2020 12:15
Test for different number of topics,producers and consumers
@xieus xieus requested a review from haboy52581 June 16, 2020 10:59
@xieus xieus added feature New feature development good first issue Good for newcomers labels Jun 16, 2020
@xieus xieus added this to the v0.5 beta release milestone Jun 16, 2020
@xieus xieus changed the title Add test for rocketmq on dockers [Performance Test] Add Test Clients for RocketMQ on Dockers Jun 16, 2020
@xieus xieus changed the title [Performance Test] Add Test Clients for RocketMQ on Dockers [Performance Test] Add Test Clients for Apache RocketMQ on Dockers Jun 16, 2020
Copy link

@xieus xieus left a 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 {
//设置生产者组名
Copy link

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.

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>

Copy link

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
Copy link

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.

Copy link

@haboy52581 haboy52581 left a 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 {

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";

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();

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);

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

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

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"

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

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);

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
#原因下篇博客见~ 哈哈哈哈

Choose a reason for hiding this comment

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

what 's 哈哈哈哈

Copy link

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

@xieus
Copy link

xieus commented Oct 9, 2020

@lly00 Thanks for uploading the test results 👍

@chenpiaoping This is also related to the MQ scaling path perf testing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New feature development good first issue Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants