rabbitmq / rabbitmq-perf-test Goto Github PK
View Code? Open in Web Editor NEWA load testing tool
Home Page: https://www.rabbitmq.com/java-tools.html
License: Other
A load testing tool
Home Page: https://www.rabbitmq.com/java-tools.html
License: Other
E.g. --randomRoutingKey
becomes --random-routing-key
. This is more common for command line tools.
The web resources of Perf HTML Tools (html, CSS, JS) are in both the html
directory and in the src/main/resources
directory of the Java project. This allows to run a web server directory from html
and to embed those resources in the final JAR file.
A better solution could be to add the html
directory as a resource directory in the Java project.
A follow-up on #15 (comment). The --flag priority=1
should do the job and avoid introducing a new option.
After download, when creating project ready, getting error following in Host.java.
The declared package "com.rabbitmq.tools" does not match the expected package "com.rabbitmq.examples.tools"
To allow PerfTest to be easier used as a library, see the discussion in #65.
It looks like the code allows you to pass in an empty list for queue names but looking at com.rabbitmq.perf.PerfTest
it would appear the code actually expects the "empty list" to be a list with an empty string in it.
This fails on Java 7 and 8 with an UnsupportedOperationException when calling AbstractList#add(Object)
when MultiCastParams#queueNames
is set to an empty list (or an NPE if you provide null
). But behaves as expected if you set queueNames to a list with an element of ""
, which passes over the linked if
branch.
The would then randomly connect to the node.
We want a single PerfTest instance to define multiple durable queues based on a pre-defined queue pattern so that it costs less to run large workloads.
To simulate 1 producer & 3 consumers on 1 queue across 1000 queues, we need to run 2000 PerfTest instances: 1000 producer PerfTest instances with 1 producer each & 1000 consumer PerfTest instances with 3 consumers each. Since every PerfTest instance requires 256MB of RAM to boot successfully, we need to reserve 500GB of RAM. Once booted, a PerfTest instance uses about 50-60MB of RAM, which translates to ~120GB of RAM. This feature would result in lower RAM requirements since we would use fewer PerfTest instances (maybe 20 instances?).
Examples for queue creation, based on a pattern:
--queue-pattern 'perf-test-%d' --from 1 --to 100 --auto-delete false
perf-test-[1..100]
--queue-pattern 'perf-test-%d' --from 100 --to 500 --auto-delete false
perf-test-[101..500]
since queue perf-test-100
was already defined.--queue-pattern 'perf-test-%d' --from 502 --to 5001 --auto-delete false
perf-test-[502.50001]
perf-test-501
queueExamples for producers and consumers distribution accross queues:
--queue-pattern 'perf-test-%d' --from 1 --to 100 --producers 10 --consumers 0 --auto-delete false
perf-test-[1..10]
queue, for a total of 10 producers. Queues perf-test-[11..90]
will have no producers. There will be no consumers.--queue-pattern 'perf-test-%d' --from 1 --to 100 --producers 150 --consumers 300 --auto-delete false
perf-test-[1..50]
queue, and 1 producer per perf-test-[51..100]
queue, for a total of 150 producers. There will be 3 consumers per perf-test-[1..100]
queue, for a total of 300 consumers.--queue-pattern 'perf-test-%d' --from 1001 --to 1100 --producers 0 --consumers 1100 --auto-delete false
perf-test-[1001..1100]
queue, for a total of 1100 consumers. There will be no producers.The current version is the last one compatible with Java 6. Can be upgraded now, as long as it supports Java 8.
I need to load test our rabbitmq instance (mqtt) with protobuf payload. It's possible with this tool?
Should be in microseconds.
min
/average
/max
are not very useful metrics (average
is not very stable/prone to swings with extreme values, for instance). 9x percentiles are the industry standard for metrics these days.
I think the following set would be sufficient for PerfTest:
min
median
Expected:
./runjava com.rabbitmq.perf.PerfTest -h amqp:// -z 10 -c 100 -x 1 -y 1 -s 1000 -f persistent
id: test-083146-493, time: 4.234s, sent: 4083 msg/s, confirmed: 3984 msg/s, nacked: 0 msg/s, received: 4010 msg/s, min/avg/max latency: 1241/8670/59891 microseconds
Unexpected:
./runjava com.rabbitmq.perf.PerfTest -h amqp:// -z 10 -c 100 -x 10 -y 10 -s 1000 -f persistent
id: test-083301-586, time: 2.240s, sent: 2424 msg/s, confirmed: 1425 msg/s, nacked: 0 msg/s, received: 22746 msg/s, min/avg/max latency: 726/98462/352270 microseconds
[{'name': 'consume',
'type': 'simple',
'params': [{'time-limit': 30,
'producer-count': 4,
'consumer-count': 2,
'auto-ack':false}]}]
When I try to run with the scenario above, the messages are actually delivered to consumers with ack. When I set autoAck to true, messages are delivered with noack.
perf-test version: 1.2.0
RMQ version 3.6.6
When I run PerfTest 2.0 RC2 like this
./scripts/PerfTest -x 1 -y 4
The output suggests consumer delivery rate is 0:
…
id: test-041747-095, starting consumer #0
id: test-041747-095, starting consumer #0, channel #0
id: test-041747-095, starting consumer #1
id: test-041747-095, starting consumer #1, channel #0
id: test-041747-095, starting consumer #2
id: test-041747-095, starting consumer #2, channel #0
id: test-041747-095, starting consumer #3
id: test-041747-095, starting consumer #3, channel #0
id: test-041747-095, starting producer #0
id: test-041747-095, starting producer #0, channel #0
id: test-041747-095, time: 1.000s, sent: 47949 msg/s, received: 0 msg/s
id: test-041747-095, time: 2.002s, sent: 62115 msg/s, received: 0 msg/s
id: test-041747-095, time: 3.044s, sent: 55256 msg/s, received: 0 msg/s
id: test-041747-095, time: 4.065s, sent: 58833 msg/s, received: 0 msg/s
id: test-041747-095, time: 5.102s, sent: 60060 msg/s, received: 0 msg/s
id: test-041747-095, time: 6.126s, sent: 60823 msg/s, received: 0 msg/s
id: test-041747-095, time: 7.139s, sent: 61483 msg/s, received: 0 msg/s
id: test-041747-095, time: 8.139s, sent: 55362 msg/s, received: 0 msg/s
id: test-041747-095, time: 9.159s, sent: 54277 msg/s, received: 0 msg/s
While with -x 1 -y 1
the rate is non-zero.
Queues and bindings are there:
Listing bindings for vhost /...
exchange amq.gen-5b_LHLcWYpkSbmj-glabIQ queue amq.gen-5b_LHLcWYpkSbmj-glabIQ []
exchange amq.gen-BIkCH6xQwklfcUo6hO6hhA queue amq.gen-BIkCH6xQwklfcUo6hO6hhA []
exchange amq.gen-CIIAQjhtmNQ6LY3OpdIpOQ queue amq.gen-CIIAQjhtmNQ6LY3OpdIpOQ []
exchange amq.gen-Rsfa1zOZ-Dv1LO-oYh2ViQ queue amq.gen-Rsfa1zOZ-Dv1LO-oYh2ViQ []
Specifying a --routing-key
does not change the behavior.
This likely is a change in #45.
As described in
http://www.rabbitmq.com/blog/2011/02/10/introducing-publisher-confirms
The code related to
volatile SortedSet unconfirmedSet = Collections.synchronizedSortedSet(new TreeSet());
is missing. Could you add it?
This can be reproduced with the following arguments:
--size 1000 --interval 30 --queue perf-test --consumers 0 --producers 1 --routingKey perf-test --autoDelete false --predeclared --flag persistent --qos 200 --multiAckEvery 50 --confirm 200
And by closing the broker abruptly.
Currently when -y 0
and -p
are combined to test a consumer application (the idea is to only use PerfTest for publishing), a server-named queue is declared and while it is auto-delete, it never has any consumers => sticks around.
This is confusing and annoying.
Reported by @liwang-pivotal.
Perhaps a more sensible behavior would be to not "configure" (pre-declare, bind) any queues when --predeclared
is passed and we have no consumers. I can't currently see any scenarios where the behavior we have right now would be desired.
This would allow to support many monitoring backends. This would need to add options for each supported backend, e.g. --metrics.datadog.apikey=a34349a3434a
.
Metrics would be the one from Java Client's MetricsCollector
(number of connections/channels, published/consumed/acknowledged/rejects messages count and rates), JVM metrics (supported out-of-the-box by Micrometer), and some specific PerfTest metrics (TBD).
When attempting:
mvn package
On a Mac OS X 10.11.6 machine with Java:
[jerryk@poopsmith .../co/rabbitmq-public-umbrella/rabbitmq-perf-test]$ java -version
java version "1.8.0_92"
Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode)
I encounter the following error and stack trace. A perfunctory google for well known problems with this symptom didn't yield any obvious smoking guns. I get the same result if I try JDK 7 rather than JDK 8.
Is something awry on my machine, or do we have a gremlin in the build for this project?
[jerryk@poopsmith .../co/rabbitmq-public-umbrella/rabbitmq-perf-test]$ mvn package
[INFO] Scanning for projects...
[INFO] Inspecting build with total of 1 modules...
[INFO] Installing Nexus Staging features:
[INFO] ... total of 1 executions of maven-deploy-plugin replaced with nexus-staging-maven-plugin
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building RabbitMQ Performance Testing Tool 1.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ perf-test ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 6 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ perf-test ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 52 source files to /Users/jerryk/co/rabbitmq-public-umbrella/rabbitmq-perf-test/target/classes
[WARNING] /Users/jerryk/co/rabbitmq-public-umbrella/rabbitmq-perf-test/src/main/java/com/rabbitmq/examples/DirectReplyToPerformance.java:[57,71] newInstance() in java.lang.Class has been deprecated
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ perf-test ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/jerryk/co/rabbitmq-public-umbrella/rabbitmq-perf-test/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:testCompile (default-testCompile) @ perf-test ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ perf-test ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ perf-test ---
[INFO] Building jar: /Users/jerryk/co/rabbitmq-public-umbrella/rabbitmq-perf-test/target/perf-test-1.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- maven-assembly-plugin:2.6:single (create-archive) @ perf-test ---
[INFO] Reading assembly descriptor: src/assembly/dist-bin.xml
[INFO] Reading assembly descriptor: src/assembly/dist-src.xml
[INFO] Building tar: /Users/jerryk/co/rabbitmq-public-umbrella/rabbitmq-perf-test/target/rabbitmq-perf-test-1.0.1-SNAPSHOT-bin.tar.gz
[WARNING] Error injecting: org.codehaus.plexus.archiver.zip.ZipArchiver
java.lang.ExceptionInInitializerError
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(java.base@9-ea/Native Method)
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(java.base@9-ea/NativeConstructorAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(java.base@9-ea/DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(java.base@9-ea/Constructor.java:453)
at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:86)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:108)
at com.google.inject.internal.ConstructorInjector.access$000(ConstructorInjector.java:32)
at com.google.inject.internal.ConstructorInjector$1.call(ConstructorInjector.java:92)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:113)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:129)
at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:269)
at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1009)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1066)
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1005)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1044)
at org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:86)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:54)
at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:113)
at org.eclipse.sisu.bean.BeanScheduler$Activator.onProvision(BeanScheduler.java:176)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:122)
at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:46)
at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1009)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1059)
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1005)
at com.google.inject.Scopes$1$1.get(Scopes.java:59)
at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:82)
at org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:263)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:243)
at org.codehaus.plexus.archiver.manager.DefaultArchiverManager.getArchiver(DefaultArchiverManager.java:63)
at org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.createArchiver(DefaultAssemblyArchiver.java:302)
at org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.createArchive(DefaultAssemblyArchiver.java:170)
at org.apache.maven.plugin.assembly.mojos.AbstractAssemblyMojo.execute(AbstractAssemblyMojo.java:484)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-ea/Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base@9-ea/NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-ea/DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(java.base@9-ea/Method.java:533)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
at org.codehaus.plexus.archiver.zip.AbstractZipArchiver.(AbstractZipArchiver.java:123)
... 60 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.530 s
[INFO] Finished at: 2016-09-26T14:24:26-07:00
[INFO] Final Memory: 21M/71M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.6:single (create-archive) on project perf-test: Execution create-archive of goal org.apache.maven.plugins:maven-assembly-plugin:2.6:single failed: An API incompatibility was encountered while executing org.apache.maven.plugins:maven-assembly-plugin:2.6:single: java.lang.ExceptionInInitializerError: null
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.apache.maven.plugins:maven-assembly-plugin:2.6
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/jerryk/.m2/repository/org/apache/maven/plugins/maven-assembly-plugin/2.6/maven-assembly-plugin-2.6.jar
[ERROR] urls[1] = file:/Users/jerryk/.m2/repository/org/slf4j/slf4j-jdk14/1.5.6/slf4j-jdk14-1.5.6.jar
[ERROR] urls[2] = file:/Users/jerryk/.m2/repository/org/slf4j/slf4j-api/1.5.6/slf4j-api-1.5.6.jar
[ERROR] urls[3] = file:/Users/jerryk/.m2/repository/org/slf4j/jcl-over-slf4j/1.5.6/jcl-over-slf4j-1.5.6.jar
[ERROR] urls[4] = file:/Users/jerryk/.m2/repository/org/apache/maven/reporting/maven-reporting-api/2.2.1/maven-reporting-api-2.2.1.jar
[ERROR] urls[5] = file:/Users/jerryk/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.1/doxia-sink-api-1.1.jar
[ERROR] urls[6] = file:/Users/jerryk/.m2/repository/org/apache/maven/doxia/doxia-logging-api/1.1/doxia-logging-api-1.1.jar
[ERROR] urls[7] = file:/Users/jerryk/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] urls[8] = file:/Users/jerryk/.m2/repository/commons-cli/commons-cli/1.2/commons-cli-1.2.jar
[ERROR] urls[9] = file:/Users/jerryk/.m2/repository/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar
[ERROR] urls[10] = file:/Users/jerryk/.m2/repository/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar
[ERROR] urls[11] = file:/Users/jerryk/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
[ERROR] urls[12] = file:/Users/jerryk/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[13] = file:/Users/jerryk/.m2/repository/org/apache/maven/shared/maven-common-artifact-filters/1.4/maven-common-artifact-filters-1.4.jar
[ERROR] urls[14] = file:/Users/jerryk/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.22/plexus-interpolation-1.22.jar
[ERROR] urls[15] = file:/Users/jerryk/.m2/repository/org/codehaus/plexus/plexus-archiver/3.0.1/plexus-archiver-3.0.1.jar
[ERROR] urls[16] = file:/Users/jerryk/.m2/repository/org/iq80/snappy/snappy/0.3/snappy-0.3.jar
[ERROR] urls[17] = file:/Users/jerryk/.m2/repository/org/apache/maven/shared/file-management/1.1/file-management-1.1.jar
[ERROR] urls[18] = file:/Users/jerryk/.m2/repository/org/apache/maven/shared/maven-shared-io/1.1/maven-shared-io-1.1.jar
[ERROR] urls[19] = file:/Users/jerryk/.m2/repository/commons-io/commons-io/2.2/commons-io-2.2.jar
[ERROR] urls[20] = file:/Users/jerryk/.m2/repository/org/apache/maven/shared/maven-filtering/1.3/maven-filtering-1.3.jar
[ERROR] urls[21] = file:/Users/jerryk/.m2/repository/org/apache/maven/shared/maven-shared-utils/0.6/maven-shared-utils-0.6.jar
[ERROR] urls[22] = file:/Users/jerryk/.m2/repository/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar
[ERROR] urls[23] = file:/Users/jerryk/.m2/repository/org/sonatype/plexus/plexus-build-api/0.0.4/plexus-build-api-0.0.4.jar
[ERROR] urls[24] = file:/Users/jerryk/.m2/repository/org/codehaus/plexus/plexus-io/2.6/plexus-io-2.6.jar
[ERROR] urls[25] = file:/Users/jerryk/.m2/repository/org/apache/maven/maven-archiver/2.5/maven-archiver-2.5.jar
[ERROR] urls[26] = file:/Users/jerryk/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.21/plexus-utils-3.0.21.jar
[ERROR] urls[27] = file:/Users/jerryk/.m2/repository/org/apache/maven/shared/maven-repository-builder/1.0/maven-repository-builder-1.0.jar
[ERROR] urls[28] = file:/Users/jerryk/.m2/repository/commons-codec/commons-codec/1.6/commons-codec-1.6.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[project>com.rabbitmq:perf-test:1.0.1-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException
[jerryk@poopsmith .../co/rabbitmq-public-umbrella/rabbitmq-perf-test]$
PerfTest
used a direct-direct
exchange by default and creates it if necessary. It would make more sense to use the amp.default
exchange. This also implies to change the default routing key (it's auto-generated by default) and use the queue name(s) instead.
See also #43.
Here's my scenario -
stable
branch of the umbrella projectgh-1388
master
branch like so:
mvn -q exec:java -Dexec.mainClass=com.rabbitmq.perf.PerfTest -Dexec.args="-y0 -p -u gh-1388 -s 512"
At this point I can see Publish numbers going up on the Overview page in the management UI, but nothing is routed to gh-1388
like I would expect.
I've tried running the same arguments to publish a set of messages as shown in this document but I see the same result ... nothing is routed to the throughput-test-14
queue:
-y0 -p -u "throughput-test-14" -s 1000 -C 1000000 --id "test-14" -f persistent
If I bind queue gh-1388
to the amq.direct
echange via the UI, I can publish to it using these arguments:
--consumers 0 --producers 1 --predeclared --queue gh-1388 --exchange amq.direct --routingKey gh-1388
By default, the queues are always auto-deleted. If we want to simulate just publishing, we need to create the queue beforehand.
When I start multiple channels with a timeout like this
bin/runjava com.rabbitmq.perf.PerfTest -z 5 -x 3 -y 3 -X 3 -Y 3
this will lead to an ArrayIndexOutOfBoundsException when the time is up:
id: martin-rabbit-test, time: 5.001s, sent: 6107 msg/s, confirmed: 6106 msg/s, nacked: 0 msg/s, received: 6107 msg/s, min/avg/max latency: 1041/2812/28202 microseconds
Main thread caught exception: java.lang.ArrayIndexOutOfBoundsException: 3
java.lang.ArrayIndexOutOfBoundsException: 3
at com.rabbitmq.perf.MulticastSet.run(MulticastSet.java:113)
at com.rabbitmq.perf.PerfTest.main(PerfTest.java:122)
The '-S' flag can then be removed, as the median/percentiles will be the only kind of output.
It would be very useful if PerfTest produced CSV files for further inspection and analysis.
Should be addressed after #27.
I've implemented a REST service which internally calls the PerfTest.main() Method.
The application server is running in ssl mode.
This causes the PerfTest to connect to AMQP with an SSLSocket, even if the URI ("-h" Parameter) starts with: amqp://
(and not with amqps://).
In my opinion this is a wrong behaviour.
I think it is located here:
private static SSLContext getSslContextIfNecessary(CommandLine cmd, Properties systemProperties) throws NoSuchAlgorithmException {
SSLContext sslContext = null;
if (cmd.hasOption("useDefaultSslContext")) {
LOGGER.info("Using default SSL context as per command line option");
sslContext = SSLContext.getDefault();
}
for (String propertyName : systemProperties.stringPropertyNames()) {
if (propertyName != null && isPropertyTlsRelated(propertyName)) {
LOGGER.info("TLS related system properties detected, using default SSL context");
sslContext = SSLContext.getDefault();
break;
}
}
return sslContext;
}
private static boolean isPropertyTlsRelated(String propertyName) {
return propertyName.startsWith("javax.net.ssl") || propertyName.startsWith("jdk.tls");
}
We can use TLS with PerfTest by specifying an AMQPS URL. Unfortunately, there's no flag to specify client/server certificates. By default, PerfTest won't try to authenticate and will trust every server. It may be enough for most tests, but some people may want to try exactly what they will use in production.
E.g. --queue-args="x-max-length=N,x-message-ttl=M,..."
.
As of de3e0e0 the -e
option was switched to use a different constructor from the rest and it was missing the number of values (arguments) it expects, which unintentionally turned it into a boolean flag.
Spotted by @mcintyred.
It could also display the git hash.
This isn't supported anymore.
This would be very useful to test consumers: some of them need the payload to be, say, valid JSON (or other format).
It would be really useful for me to be able to add this as a maven repo in my pom.xml file. I didn't see it on http://mavenrepository.com/. Does it exist elsewhere?
The latency to receive a message is calculated based on a value in the message payload. This latency is then used to conditionally display the metrics on received messages.
This works well as long as the payload contains the time when the message was sent (the default) but it doesn't work anymore when specifying a given payload.
Putting and retrieving the time of the sending to/from an header should do the trick.
References #23.
Now PerfTest depends on Java Client 4.0, it needs to include a binding for SLF4J.
The --random-routing-key
option allows to use a different, random routing key for every sent message. Producer
uses UUID.randomUUID().toString
, which is fine when all messages must have a different routing key. For use cases that need just a bit of randomness (e.g. different random routing keys to balance messages over a sharded queue or through a consistent hash exchange), generating a few random keys at the beginning and re-using them should be fine enough. This could make the sending faster than with true randomness (a simple, isolated test over a 1 M iteration shows using a cache of 10 random values can be 100 times faster than using UUID.randomUUID().toString
).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.