Skip to content

Commit 1e8f8d0

Browse files
committed
Document usage of Netty
1 parent fae2150 commit 1e8f8d0

File tree

1 file changed

+13
-21
lines changed

1 file changed

+13
-21
lines changed

src/docs/asciidoc/usage-advanced.adoc

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ Another way to avoid `java.lang.OutOfMemoryError: unable to create new native th
276276
exceptions is to tune the number of file descriptors allowed per process
277277
at the OS level, as some distributions use very low limits.
278278
Here the recommendations are the same as for the broker, so you
279-
can refer to our https://www.rabbitmq.com/networking.html#os-tuning[networking guide].
279+
can refer to our https://www.rabbitmq.com/docs/networking#os-tuning[networking guide].
280280

281281
[[workloads-with-a-large-number-of-clients]]
282282
== Workloads With a Large Number of Clients
@@ -386,37 +386,29 @@ These are 1-thread thread pools in this case, so this is 10 threads overall inst
386386
huge resource saving to simulate more clients with a single PerfTest instance for large IoT workloads.
387387

388388
By default, PerfTest uses blocking network socket I/O to communicate with
389-
the broker. This mode works fine for clients in many cases but the RabbitMQ Java client
390-
also supports an https://www.rabbitmq.com/api-guide.html#java-nio[asynchronous I/O mode],
391-
where resources like threads can be easily tuned. The goal here is to use as few
392-
resources as possible to simulate as much load as possible with a single PerfTest instance.
389+
the broker.
390+
This mode works fine for clients in many cases but the RabbitMQ Java client can also use Netty for its network layer.
391+
Netty uses a multithreaded event loop to handle I/O operation and the number of threads can be easily tuned.
392+
The goal here is to use as few resources as possible to simulate as much load as possible with a single PerfTest instance.
393393
In the slow publisher example above, a handful of threads should be enough
394-
to handle the I/O. That's what the
395-
`--nio-threads` flag is for:
394+
to handle the I/O.
395+
That's what the `--netty-threads` flag is for:
396396

397-
.Reducing the number of IO threads by enabling the NIO mode with `--nio-threads`
397+
.Reducing the number of I/O threads by using Netty with `--netty-threads`
398398
[source,bash,indent=0]
399399
--------
400400
java -jar perf-test.jar --queue-pattern 'perf-test-%d' \
401401
--queue-pattern-from 1 --queue-pattern-to 1000 \
402402
--producers 1000 --consumers 1000 \
403-
--heartbeat-sender-threads 10 \
404403
--publishing-interval 60 --producer-random-start-delay 1800 \
405404
--producer-scheduler-threads 10 \
406-
--nio-threads 10
405+
--consumers-thread-pools 10 \
406+
--netty-threads 10
407407
--------
408408

409-
This way PerfTest will use 12 threads for I/O over all the connections.
410-
With the default blocking I/O mode, each producer (or consumer)
411-
uses a thread for the I/O loop, that is 2000 threads to simulate 1000 producers and
412-
1000 consumers. Using NIO in PerfTest can dramatically reduce the resources used
413-
to simulate workloads with a large number of connections with appropriate tuning.
414-
415-
Note that in NIO mode the number of threads used can increase temporarily when connections close
416-
unexpectedly and connection recovery kicks in. This is due to the NIO mode dispatching
417-
connection closing to non-I/O threads to avoid deadlocks. Connection recovery can be disabled
418-
with the `--disable-connection-recovery` flag.
419-
409+
This way PerfTest will use 10 threads for I/O over all the connections.
410+
With the default blocking I/O mode, each producer (or consumer) uses a thread for the I/O loop, that is 2000 threads to simulate 1000 producers and 1000 consumers.
411+
Using Netty in PerfTest can dramatically reduce the resources used to simulate workloads with a large number of connections with appropriate tuning.
420412

421413
== Running Producers and Consumers on Different Machines
422414

0 commit comments

Comments
 (0)