Skip to content

Commit

Permalink
Throughput benchmarks clean up (#114)
Browse files Browse the repository at this point in the history
* Put Throughput_ArtemisNetCoreClient in the proper dir

* Update readme with benchmark results
  • Loading branch information
Havret authored May 29, 2024
1 parent 09a018b commit 41a994c
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ArtemisNetCoreClient.sln
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Throughput", "Throughput",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Throughput_NMS.AMQP", "benchmark\Throughput_NMS.AMQP\Throughput_NMS.AMQP.csproj", "{7E352FBC-72E8-4D8B-B35F-5EB7ECC234B3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Throughput_ArtemisNetCoreClient", "Throughput_ArtemisNetCoreClient\Throughput_ArtemisNetCoreClient.csproj", "{204727DC-1368-4BD9-A918-7788AE474782}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Throughput_ArtemisNetCoreClient", "benchmark\Throughput_ArtemisNetCoreClient\Throughput_ArtemisNetCoreClient.csproj", "{204727DC-1368-4BD9-A918-7788AE474782}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
37 changes: 35 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ var message = await consumer.ReceiveMessageAsync();

## Performance

All benchmarks are conducted on the following hardware and software configuration:

```sh
OS=macOS 14.5 (23F79) [Darwin 23.5.0]
Apple M1 Pro, 1 CPU, 10 logical and 10 physical cores
Expand All @@ -100,19 +102,50 @@ Apple M1 Pro, 1 CPU, 10 logical and 10 physical cores
DefaultJob : .NET 8.0.0 (8.0.23.53103), Arm64 RyuJIT
```

Both the benchmark applications and the broker are hosted on the same machine, with the broker running inside a Docker container. Configuration for the queues used in benchmarks is detailed within the [`broker.xml`](test/artemis/broker.xml) file. Each message utilized in the benchmarks carries a simple payload of 1KB or a randomly generated payload.

The baseline for these benchmarks is set using the official [Apache NMS.AMQP library](https://github.com/apache/activemq-nms-amqp).

### Request-Reply (PingPong) Benchmark

This benchmark compares the performance of two client libraries — ArtemisNetCoreClient and NMS.AMQP — in a request-reply messaging scenario. The test setup involves two components, `Ping` and `Pong`:
This benchmark measures the performance in a request-reply messaging scenario. The test setup involves two components, `Ping` and `Pong`:

- **`Ping`**: Sends a message to `Pong` and starts a timer.
- **`Pong`**: Receives the message and responds back immediately.

The cycle of messages between `Ping` and `Pong` provides metrics on round-trip time, throughput, and system efficiency when under load. Each test cycle involved sending and receiving 10,000 messages, with performance measured by recording the time taken to process these messages and calculating the throughput in messages per second. This benchmark is designed to demonstrate how each client library handles intensive message exchanges, offering insights into their suitability for high-demand environments.
The performance is assessed by measuring the round-trip time and calculating the throughput in terms of round-trips per second, over the course of sending and receiving 10,000 messages.

| Library | Round-trips per Second |
|------------------------|------------------------|
| ArtemisNetCoreClient | 1990.34 |
| NMS.AMQP | 948.13 |

<div align="center">
<img src="./readme/PingPong_Benchmark.svg" alt="Benchmark Results Diagram"/>
</div>

### Throughput

This benchmark assesses the ability of the library to handle large volumes of messages efficiently, focusing on both sending and receiving processes:

- **`Producer`**: Sends 100,000 messages. The performance metric is the rate of messages sent per second (msgs/s).
- **`Consumer`**: Receives an equivalent volume of messages. The performance metric is the rate of messages processed per second (msgs/s).

Results show how quickly each library can transmit and receive messages:

| Library | Sending msgs/s | Consuming msgs/s |
|------------------------|----------------|------------------|
| ArtemisNetCoreClient | 5392.804 | 139728.836 |
| NMS.AMQP | 2667.195 | 72159.994 |

<div align="center">
<img src="./readme/Throughput_Benchmark.svg" alt="Benchmark Results Diagram"/>
</div>

<div align="center">
<img src="./readme/Throughput_Benchmark_2.svg" alt="Benchmark Results Diagram"/>
</div>

## Running the tests

To run the tests, you need an Apache ActiveMQ Artemis server. The server can be hosted in a Docker container.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\src\ArtemisNetCoreClient\ArtemisNetCoreClient.csproj" />
<ProjectReference Include="..\..\src\ArtemisNetCoreClient\ArtemisNetCoreClient.csproj" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion readme/PingPong_Benchmark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions readme/Throughput_Benchmark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions readme/Throughput_Benchmark_2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 41a994c

Please sign in to comment.