Speed and footprint
These are measured figures for MicroRTI 0.5.0, the HLA 4 RTI: how much memory and CPU the microrti
server takes, how long a message takes to go from one federate to another, how many messages it
delivers per second, and how fast a time-managed federation can step. The conditions of the tests come
first, so that you can judge what the figures apply to.
Test conditions
- One computer with 8 cores and 16 GB of memory, in normal use with other programs running. Everything
ran over the loopback interface (
127.0.0.1). - The server
microrti0.5.0, built in release mode bycargo install microrti --version 0.5.0. - Federates written in Rust on
microrti-client0.5.0, built in release mode, with the immediate callback model. The federates of a test all ran in one process, separate from the server, and shared the 8 cores with it. - A FOM module with three interaction classes, each carrying one parameter of type
HLAopaqueData: two in receive order for latency and throughput, one in timestamp order for logical time. - The whole series of tests ran three times, each time against a freshly started server, and the page gives the median of the three runs. A latency figure comes from 10 000 exchanges (2 000 for 64 KiB messages), after 1 000 exchanges of warm-up (500 under load), and is given as the median (p50) and the 99th percentile (p99).
- Memory is the resident size the system reports for the server process, one second after the start or after the last federate joined, on a server started for that measurement alone.
Two references were measured in the same conditions, so that the figures have something to stand next to:
- a bare TCP relay, a program that copies bytes between two sockets with no HLA at all: the cost of the loopback network and of a hub in the middle;
- the RTI inside the federates’ process (
EmbeddedRti): the same HLA services without the network.
No other RTI is measured on this page.
Footprint
| What | Measured |
|---|---|
| Server binary for Linux x86-64 (static, musl, no shared library needed) | 16.3 MB; 8.6 MB as the release archive, with microrti-cli |
| From start to listening on all four transports, with a self-signed TLS certificate made at start | 14 ms |
| Fresh server | 8.6 MB of memory, 7 threads |
| With 10, 100, 500 and 1 000 federates joined | 15.8, 21.9, 48.6 and 82.0 MB of memory; still 7 threads |
| CPU while 1 000 joined federates are idle | 0.04 s of CPU time in 10 s |
| One federate on the Rust client | 2 threads and about 125 KB of memory |
| 1 000 federates connecting and joining, one after the other | 1.0 s |
The server’s threads do not grow with the number of federates, and its memory grows by about 67 KB per joined federate. A connect takes 200 µs and a join 81 µs (medians of 200).
---
config:
xyChart:
height: 320
---
xychart-beta
title "Server memory with N federates joined (MB)"
x-axis "Federates joined" ["0", "10", "100", "500", "1 000"]
y-axis "MB" 0 --> 90
bar [8.6, 15.8, 21.9, 48.6, 82.0]Latency
Federate A sends an interaction; federate B answers it with another interaction from inside its callback; A measures the time until the answer arrives. The message goes through the RTI twice.
| Path | p50 | p99 |
|---|---|---|
| Bare TCP relay (reference) | 46 µs | 90 µs |
| MicroRTI over TCP | 156 µs | 246 µs |
| MicroRTI over TLS 1.3 | 166 µs | 265 µs |
| MicroRTI over WebSocket | 168 µs | 274 µs |
| MicroRTI over secure WebSocket | 180 µs | 276 µs |
EmbeddedRti, in the process (reference) | 14 µs | 33 µs |
---
config:
xyChart:
chartOrientation: horizontal
height: 340
---
xychart-beta
title "Round trip A to B to A, median (µs)"
x-axis ["TCP relay (reference)", "MicroRTI, TCP", "MicroRTI, TLS 1.3", "MicroRTI, WebSocket", "MicroRTI, secure WebSocket", "In process (reference)"]
y-axis "µs" 0 --> 200
bar [46, 156, 166, 168, 180, 14]Over TCP the RTI adds about 110 µs to the relay, or about 55 µs each time a message passes through it. Encryption and WebSocket framing add 10 to 25 µs. The size of the message matters little: with 1 KiB of data the round trip takes 161 µs, with 64 KiB 234 µs. One service call on its own, from the request to the RTI’s answer, takes about 80 µs over TCP and 5 µs in the process.
Throughput
Each federate sends interactions of 100 bytes as fast as it can; the receivers count what arrives. Every interaction was delivered, in every run.
| Pattern | Interactions sent per second | Deliveries per second |
|---|---|---|
| 1 sender, 1 receiver | 13 000 | 13 000 |
| 1 sender, 10 receivers | 4 300 | 42 800 |
| 10 senders, 1 receiver | 39 000 | 33 500 |
| 20 federates, each sending to the 19 others | 7 900 | 149 700 |
The Rust client waits for the RTI’s answer to each call, so one federate sending in a loop is held to about one call per 80 µs. Several federates send in parallel. The RTI applies the calls one at a time, and on this machine it peaks at about 150 000 deliveries per second.
Logical time
Every federate is time-regulating, with a lookahead of 1, and time-constrained, in a federation using
HLAinteger64Time. In a loop, each one sends its timestamped interactions for the next step, asks to
advance to the next integer (Time Advance Request, 8.8) and waits for the grant. A step is done when
every federate has its grant.
| Federation | Steps per second, no interaction | Steps per second, 1 timestamped interaction per federate and step |
|---|---|---|
| 2 federates | 10 000 | 4 300 |
| 4 federates | 5 500 | 2 300 |
| 8 federates | 3 300 | 900 |
| 16 federates | 1 500 | 325 |
8 federates on EmbeddedRti (reference) | 4 900 | 2 000 |
---
config:
xyChart:
height: 320
---
xychart-beta
title "Steps per second, 1 timestamped interaction per federate and step"
x-axis "Federates" ["2", "4", "8", "16"]
y-axis "Steps per second" 0 --> 5000
bar [4300, 2300, 900, 325]When the federates send timestamped interactions, the synchronisation was checked at every step and for every federate. An interaction stamped t arrived only while its receiver was asking to advance to t, never earlier and never after the grant. Each grant to t came with all the interactions stamped t that the other federates had sent. No federate was ever granted a time more than one step ahead of another. Each federate added up the values of the step, its own and those it received, and all of them found the same sum at every step. All of this held in every run. As a control, the same federates made time-regulating but not time-constrained wait for nobody: 4 federates over 500 steps then gave more than 9 000 violations (interactions outside their step, grants without all the interactions of their step) and sums that differ.
The federates do the work of a step at the same time. With 4 federates that each spend 1 ms of computation per step, the federation makes 684 steps per second, against 2 265 without the computation: each step costs the 1 ms of work plus about 0.45 ms of coordination. Done one federate after another, the same work would allow fewer than 250 steps per second.
A federation of 16 federates that each send one timestamped interaction per step, and that steps 50 times per second of wall-clock time, uses about a sixth of what the RTI can do here.
Latency under load
The same round trip, measured while 18 other federates send interactions to each other at a fixed rate.
| Background traffic | Deliveries per second | p50 | p99 |
|---|---|---|---|
| None | 0 | 156 µs | 246 µs |
| 100 interactions per second from each of the 18 | 30 600 | 167 µs | 2.0 ms |
| 200 per second from each | 61 200 | 185 µs | 3.2 ms |
| 400 per second from each, the most the RTI delivers here | 122 400 | 2.2 ms | 6.1 ms |
The median hardly moves until the RTI is near its limit; the slowest exchanges grow first. At the limit, federates wait longer for the answer to each call and messages queue up, but none is lost.
What these figures do not say
- Everything ran on one machine, over loopback. A real network adds its own latency to every pass through the RTI.
- The federates and the RTI shared 8 cores; on separate machines the RTI would have them to itself.
- Only interactions were measured: no attribute updates with regions, ownership transfers or saves.
- Figures from another machine, another system or another load can differ a lot. Measure in your own conditions before you size a federation.
Next steps
- Configure the RTI, including the Federate Protocol timeouts
- An RTI inside your process
- Logical time, explained
- Monte-Carlo runs and designs of experiments