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 microrti 0.5.0, built in release mode by cargo install microrti --version 0.5.0.
  • Federates written in Rust on microrti-client 0.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

WhatMeasured
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 start14 ms
Fresh server8.6 MB of memory, 7 threads
With 10, 100, 500 and 1 000 federates joined15.8, 21.9, 48.6 and 82.0 MB of memory; still 7 threads
CPU while 1 000 joined federates are idle0.04 s of CPU time in 10 s
One federate on the Rust client2 threads and about 125 KB of memory
1 000 federates connecting and joining, one after the other1.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.

Pathp50p99
Bare TCP relay (reference)46 µs90 µs
MicroRTI over TCP156 µs246 µs
MicroRTI over TLS 1.3166 µs265 µs
MicroRTI over WebSocket168 µs274 µs
MicroRTI over secure WebSocket180 µs276 µs
EmbeddedRti, in the process (reference)14 µs33 µ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.

PatternInteractions sent per secondDeliveries per second
1 sender, 1 receiver13 00013 000
1 sender, 10 receivers4 30042 800
10 senders, 1 receiver39 00033 500
20 federates, each sending to the 19 others7 900149 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.

FederationSteps per second, no interactionSteps per second, 1 timestamped interaction per federate and step
2 federates10 0004 300
4 federates5 5002 300
8 federates3 300900
16 federates1 500325
8 federates on EmbeddedRti (reference)4 9002 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 trafficDeliveries per secondp50p99
None0156 µs246 µs
100 interactions per second from each of the 1830 600167 µs2.0 ms
200 per second from each61 200185 µs3.2 ms
400 per second from each, the most the RTI delivers here122 4002.2 ms6.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