Frontend to run real‑time performance tests on a host
720
Web application in Python (FastAPI) that provides a frontend to run real‑time performance tests on the host.
Modern web UI (Tailwind, Chart.js).
Internationalisation (French / English):
Accept-Language header.cyclictest tab:
cyclictest with the following parameters:
-d (µs, default: 200, 0 to disable)./sys/devices/system/cpu/isolated
(fallback to all online CPUs except CPU0).cyclictest on the host and parses the output (including Debian histogram format).hwlatdetect tab:
hwlatdetect with:
inner/outer, summary lines).systemcheck tab:
tuned-adm active)./sys/devices/system/cpu/smt/active)./proc/cmdline): nohz_full, rcu_nocbs, C‑states limits, etc.sched_rt_runtime_us, sched_rt_period_us)./proc/irq/*/smp_affinity)./sys/class/ptp).OK, WARNING, INFO, etc.).seapath tab:
/etc/corosync/corosync.conf./run/pacemaker/cib/cib.xml preferred,
falls back to /var/lib/pacemaker/cib/cib.xml, live cibadmin -Q, crm_mon --as-xml,
or the latest pengine input file).ocf:seapath:VirtualDomain resources with their state (started, stopped,
disabled, unknown) and the node they run on.tuned.conf sections), isolated CPUs,
boot cmdline (RT‑relevant parameters highlighted), and RT sysctl values.nsenter into PID‑1 namespaces to reach
host‑only binaries (cibadmin, rbd, etc.).cyclictest installed on the host (package rt-tests on most Linux distros).root or appropriate RT capabilities).rbd (package ceph-common) — to retrieve per‑VM libvirt XML from Ceph RBD metadata.cibadmin or crm_mon — to query the live Pacemaker CIB (only needed if no CIB file is
accessible at /run/pacemaker/cib/cib.xml or /var/lib/pacemaker/cib/cib.xml)./etc/corosync/corosync.conf (cluster detection) and /etc/ceph (RBD auth).cd rtperfui
python -m venv .venv
source .venv/bin/activate # on Windows: .venv\Scripts\activate
pip install -r requirements.txt
From the project root:
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
Then open http://localhost:8000 in your browser.
cyclictest tab usage/).If cyclictest is not found or returns an error, an explicit error message is shown below the form.
hwlatdetect:
hwlatdetect tab.systemcheck:
systemcheck tab.OK, WARNING, INFO) helps quickly spot items that may need attention.seapath:
seapath tab.A Dockerfile is provided to build a self‑contained image including:
requirements.txt).rt-tests (to have cyclictest, hwlatdetect, etc. inside the container).cd rtperfui
podman build -t rtperfui:latest .
# or
docker build -t rtperfui:latest .
The image exposes port 8000 and runs:
uvicorn app.main:app --host 0.0.0.0 --port 8000
podman run --rm -p 8000:8000 \
--privileged \
--cap-add=SYS_NICE \
--ulimit rtprio=99 \
--ulimit memlock=-1 \
-v /sys:/sys \
-v /run/tuned:/run/tuned:ro \
-v /etc/tuned:/etc/tuned:ro \
-v /dev/cpu_dma_latency:/dev/cpu_dma_latency \
-v /run:/run:ro \
-v /var/lib/pacemaker:/var/lib/pacemaker:ro \
-v /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro \
-v /etc/ceph:/etc/ceph:ro \
rtperfui:latest
Note:
/procis not mounted explicitly. In a--privilegedcontainer, the container's own/procalready reflects host kernel values for non‑namespaced paths (cmdline,cpuinfo,meminfo,sys/kernel/*,sys/vm/*,irq, etc.). Mounting/procwholesale breaksruncnetwork initialisation (read‑only filesystem error).
Then open http://localhost:8000.
An example Quadlet file is provided: rtperfui.container.
Contents:
[Unit]
Description=rtperfui real-time test UI container
[Container]
Image=docker.io/insatomcat/rtperfui:latest
ContainerName=rtperfui
PublishPort=8000:8000
User=root
# Capabilities / ulimits for real-time
PodmanArgs=--privileged
AddCapability=CAP_SYS_NICE
Ulimit=rtprio=99
Ulimit=memlock=-1
# Expose host sysfs needed for checks and RT tools
# Note: /proc is NOT mounted — a --privileged container's own /proc already
# reflects host kernel values; mounting it wholesale breaks runc network init.
Volume=/sys:/sys
Volume=/run/tuned:/run/tuned:ro
Volume=/etc/tuned:/etc/tuned:ro
Volume=/dev/cpu_dma_latency:/dev/cpu_dma_latency
# Runtime directories (covers pacemaker variants under /run/*)
Volume=/run:/run:ro
# Pacemaker state (CIB + pengine inputs) — needed for Seapath tab
Volume=/var/lib/pacemaker:/var/lib/pacemaker:ro
# Corosync config — used to detect cluster mode
Volume=/etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro
# Ceph config + keyring — needed for rbd image-meta get (VM XML retrieval)
Volume=/etc/ceph:/etc/ceph:ro
Environment=PYTHONUNBUFFERED=1
[Service]
Restart=always
[Install]
WantedBy=default.target
Copy the file into the user Quadlet directory:
mkdir -p ~/.config/containers/systemd
cp rtperfui.container ~/.config/containers/systemd/
Reload systemd (user session) and start the service:
systemctl --user daemon-reload
systemctl --user enable --now rtperfui.service
The application will then listen on host port 8000, with:
CAP_SYS_NICE and RT‑friendly ulimit values./sys and /proc for system checks./dev/cpu_dma_latency to pin CPU DMA latency.cyclictest options (multi‑threads, detailed histograms, etc.).Content type
Image
Digest
sha256:0dad06b4c…
Size
132.7 MB
Last updated
4 months ago
docker pull insatomcat/rtperfui