Skip to content

chore: add a script that measures what a dedicated host needs - #1579

Merged
vdmkenny merged 1 commit into
OpenReliant:mainfrom
LordBlacksun:chore/measure-host
Nov 28, 2026
Merged

vdmkenny merged 1 commit into
OpenReliant:mainfrom
LordBlacksun:chore/measure-host

Conversation

@LordBlacksun

Copy link
Copy Markdown
Member

Adds scripts/measure-server.py, the script behind the host measurements on #1405, as you asked there, and a paragraph pointing to it under "Optional Prometheus metrics" in the configuration guide.

It starts a headless host with metrics on, joins it with terminal pilots over loopback, waits until every pilot is flying, and then prints the host's CPU use, memory, step time and traffic every 10 seconds as JSON. On Linux and macOS the pilots fire and turn at random. At the end each pilot is sent Q, and the host must count them all leaving, which shows their keys arrived. On Windows the terminal client reads keys from the console, so there the pilots fly fixed turns with their guns off, and the script says so.

With 1.1.0-rc.3's Linux build, in WSL on a Ryzen 9 7950X3D, 120 s samples:

Run Pilots Host CPU, one core Average step Slow steps Resident Private Sent Received Messages sent
Asteroid Field, guns on, random turns 8 4.1 to 4.7% 0.13 to 0.15 ms 0 74 MiB 55 MiB 417 to 432 kB/s 14.0 to 14.1 kB/s 1,400 to 1,630/s
Asteroid Field, guns off 8 3.7 to 4.1% 0.11 to 0.14 ms 0 74 MiB 55 MiB 381 to 387 kB/s 12.5 kB/s 1,200 to 1,350/s
Co-op Mission 1, guns on, random turns 4 3.0 to 3.3% 0.13 to 0.16 ms 0 86 MiB (peak 90) 67 to 68 MiB 150 to 164 kB/s 7.0 kB/s 1,000 to 1,100/s

The guns-off row sends what the Windows deathmatch rows on #1405 sent (about 385 kB/s and 1,200 to 1,300 messages a second), which fits the correction there.

What is left: the macOS path reads CPU and memory with ps and is untested. It reports no peak or private memory.

Refs #1405

Kenny asked on OpenReliant#1405 for the script behind the headless host measurements there. This is that
script, made to run on Linux, macOS and Windows, with the docs pointing to it.

It waits until every pilot is flying before it samples, and on Linux and macOS it shows that the
pilots' keys arrived: at the end it sends each one Q and the host must count them all leaving.
The first version had no such check. On Windows the keys never reached the pilots, so the guns
were off in the numbers first posted on OpenReliant#1405. On Windows the script now flies fixed turns with
the guns off and says so.
@vdmkenny
vdmkenny merged commit 973b856 into OpenReliant:main Nov 28, 2026
2 checks passed
@LordBlacksun
LordBlacksun deleted the chore/measure-host branch November 28, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants