-
Notifications
You must be signed in to change notification settings - Fork 900
Performance Testing
Martin Thompson edited this page Jun 3, 2017
·
65 revisions
Aeron is designed to provide high-throughput and low-latency message transport from publishers to subscribers.
A number of tests are provided in the samples module to test both latency and throughput.
Comparisons of Aeron with other algorithms for RTT IPC latency can be found here.
Adjust socket limits:
Linux
$ sudo sysctl net.core.rmem_max=2097152
$ sudo sysctl net.core.wmem_max=2097152
FreeBSD / Darwin
$ sysctl -w kern.ipc.maxsockbuf=2097152
Explanation of configuration options:
- -XX:BiasedLockingStartupDelay=0: The driver has no contended locks so can benefit from avoiding the CAS operations to take a lock.
- -Daeron.mtu.length=16384: Increase the size of the maximum transmission unit to reduce system calls in a throughput scenario.
- -Daeron.socket.so_sndbuf=2097152: Increase the size of OS socket send buffer (SO_SNDBUF) to account for Bandwidth Delay Product (BDP) on a high bandwidth network.
- -Daeron.socket.so_rcvbuf=2097152: Increase the size of OS socket receive buffer (SO_RCVBUF) to account for Bandwidth Delay Product (BDP) on a high bandwidth network.
- -Daeron.rcv.initial.window.length=2097152: Set the initial window for flow control to account for BDP.
- -Dagrona.disable.bounds.checks=true: Disable bound checking to reduce instruction path on private secure networks.
- -XX:+UnlockDiagnosticVMOptions -XX:GuaranteedSafepointInterval=300000: To reduce the frequency of the JVM bringing all threads to a safepoint.
Run the media driver:
$ java -cp aeron-samples/build/libs/samples.jar \
-XX:BiasedLockingStartupDelay=0 \
-Daeron.mtu.length=16384 \
-Daeron.socket.so_sndbuf=2097152 \
-Daeron.socket.so_rcvbuf=2097152 \
-Daeron.rcv.initial.window.length=2097152 \
-Dagrona.disable.bounds.checks=true \
io.aeron.samples.LowLatencyMediaDriver
Run the Subscriber:
$ java -cp aeron-samples/build/libs/samples.jar \
-Dagrona.disable.bounds.checks=true \
-Daeron.sample.frameCountLimit=256 \
io.aeron.samples.RateSubscriber
Run the Publisher:
$ java -cp aeron-samples/build/libs/samples.jar \
-Daeron.sample.messageLength=32 \
-Daeron.sample.messages=500000000 \
-Dagrona.disable.bounds.checks=true \
io.aeron.samples.StreamingPublisher
IPC throughput via Shared Memory that bypasses the network:
$ java -cp aeron-samples/build/libs/samples.jar \
-Dagrona.disable.bounds.checks=true \
-Daeron.sample.messageLength=32 \
io.aeron.samples.EmbeddedIpcThroughput
Currently no specific changes required.
Run the media driver:
$ java -cp aeron-samples/build/libs/samples.jar \
-XX:+UnlockDiagnosticVMOptions \
-XX:GuaranteedSafepointInterval=300000 \
-XX:BiasedLockingStartupDelay=0 \
-Dagrona.disable.bounds.checks=true \
io.aeron.samples.LowLatencyMediaDriver
Run the Subscriber:
$ java -cp aeron-samples/build/libs/samples.jar \
-XX:+UnlockDiagnosticVMOptions \
-XX:GuaranteedSafepointInterval=300000 \
-Dagrona.disable.bounds.checks=true \
io.aeron.samples.Pong
Run the Publisher:
$ java -cp aeron-samples/build/libs/samples.jar \
-XX:+UnlockDiagnosticVMOptions \
-XX:GuaranteedSafepointInterval=300000 \
-Daeron.sample.messages=100000 \
-Daeron.sample.messageLength=32 \
-Dagrona.disable.bounds.checks=true \
io.aeron.samples.Ping
- Java Flight Recorder:
-XX:+UnlockCommercialFeatures -XX:+FlightRecorder -XX:+UnlockDiagnosticVMOptions -XX:+DebugNonSafepoints
- Get the hotspot compiler log:
-XX:+UnlockDiagnosticVMOptions -XX:+TraceClassLoading -XX:+LogCompilation -XX:+PrintAssembly
(see also http://mechanical-sympathy.blogspot.co.uk/2013/06/printing-generated-assembly-code-from.html)