Repository navigation
Ariadne conference: idle clients stop paying for their own traffic meters - #995
Merged
Merged
Conversation
…ters
An idle client (camera and mic off, nothing moving) sent ~5 kb/s and received
~13 kb/s through the relay, nearly all of it the traffic meters. Every second
each end rewrote net.{rtt_ms,in_kbps,out_kbps}, net.relay.* and server.net.*
with a touch and a value (two ~130-byte state messages per number). The
readings never repeat exactly, partly because those writes are what they
measure, and the WebSocket re-broadcast then sent each change once more.
- room_net: a meter reading is published only when it moves off the one in
the tree by a tenth of it, or by 2 kb/s or 5 ms if that is more (or between
measured and not). It is written as two significant figures, never finer
than a tenth, and each change journals one mutation (set_changed_once).
server.net.links is written when it changes.
- The published rates are measured over net_publish_period_s (5 s): arigl
keeps a second rate meter for the room's copy (its own row stays per
second), and arisrv publishes and logs every 5 s. Over 1 s windows a
meter's own write and its re-broadcast pushed the next reading past the
band and back.
- write_participant_net takes FORCE. arigl sets it during its post-reconnect
rejoin window, so a relay that lost the client's readings gets them again
even though a steady reading would never move.
- The relay's energy reserve stops re-stamping every 5 s once it matches the
published value (full, at rest); the client's prediction refills to the
same value. write_avatar_reserve journals one mutation per changed leaf.
- arisrv_aoi_bench follows the relay's new meter cadence.
Tests: room_intrinsics_test NetReadingsReplicateOnlyWhenTheyMove;
holon_sync_test AFullReserveAtRestIsNotRestamped.
…ng app's 0.1 s ari_chat_component failed every ctest attempt on a Debug CI runner with "did not complete: time_limit_exceeded" on different subtests each time, though it passes in about a second on other Debug runs and in 0.2 s locally. ari test runs each test program as an action, and an action gets ariadne.limits.action_max_time, 0.1 s of (mostly CPU) time. The chat component's tests take a few thousand steps each: a few milliseconds in a Release build, close to the 0.1 s in a Debug one, and past it on a runner that ran the whole suite about twice as slowly as usual. The same subtests fail locally once the budget is cut to a millisecond. A test checks what a document does, not how fast. Under ari test a program's time backstop is now the run's own --timeout (30 s by default), while the step cap (action_max_steps) still stops a runaway. --action-time S sets it: 0.1 holds a document to what a running app allows, and 0 lifts it. Tests: AriTest.AProgramMayRunAsLongAsTheTimeout (the default and 0 pass, a millionth of a second kills the same program, a bad value is refused) and AriadneHostCli.ActionTimeIsSecondsFromZero.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
One idle conference client (camera and mic off, nothing moving) sent ~5 kb/s and received ~13 kb/s
through the relay. Nearly all of it was the traffic meters:
net.{rtt_ms,in_kbps,out_kbps},net.relay.*andserver.net.*.What changes
room_net):2 kb/s or 5 ms if that is more, or when it changes between measured and not.
1200,48,0.4).set_changed_once).server.net.linksis written when itchanges.
totals.
net_publish_period_s):self.ping/down/up) stillupdates every second.
window. That pushed the next reading past the band and back, so the relay's
out_kbpsstillwrote 0.7/s.
write_participant_nettakesforce. arigl sets it during its post-reconnectrejoin window, so a relay that lost the client's readings gets them back even when a steady
reading would never move.
(full, at rest). The client's prediction refills to the same value, and it was corrected on the way
there.
write_avatar_reservejournals one mutation per changed leaf instead of touch + value onboth.
arisrv_aoi_benchfollows the relay's new meter cadence.The Users window shows whole kb/s and ms, so it stays within a tenth of the measured value. A
reading can now be up to 5 s old.
Measured
Setup:
carries. Payload bytes only.
-O1, which doesn't change itstraffic.
What's left:
pose.server_tick(1.0–1.3 kb/s), plus pings and the pose stream's heartbeat. Themeters are under 0.1 kb/s.
out after.
Before, the down traffic broke down as:
pose.server_tick: 0.8 kb/senergy.*: 0.6 kb/sNot changed: the tree's
pose.server_tickheartbeatThe heartbeat is what remains of an idle client's downlink. Stretching it to 5 s (the pose stream
already carries a 1 s heartbeat) was tried and backed out:
stream sample. It seeks back, then forward again.
HolonTest.RealignCounterCountsSeekspins this today: "a peer whose tick a heartbeat left old ...seeks the clock back".
5 s it counted 4 or more.
far older, a restarted relay, as
client_pump's 10 s leftover rule), the heartbeat could bestretched. That is a holon clock change for its own PR.
Tests
room_intrinsics_testNetReadingsReplicateOnlyWhenTheyMove: the bands, the rounding, onemutation per change, measured/unmeasured transitions, the forced re-send, and the relay's per-link
meters and totals.
holon_sync_testAFullReserveAtRestIsNotRestamped: a full reserve at rest writes nothing for10 s, a walk publishes again, and the writer journals one mutation per changed leaf.
room_intrinsics_test,holon_sync_test,room_avatar_test,room_aoi_test,room_aoi_relay_testandroom_relay_integration_testpass on a Windows static Release build.Deploy
This needs a relay deploy and a page deploy to take effect in production.
CI note: this branch also carries #1003
The first run's only red check was
ari_chat_componentinpackage-linux / libcvc-debug-grpc. Thatis a timing flake unrelated to this change:
ari testgave each test program a running app's 0.1 sbudget, and that runner was about twice as slow as usual. #1003 fixes it. Its commit (84c3b2f) is
cherry-picked on top here so this PR's CI includes the fix. If #1003 merges first, a rebase onto
master drops the duplicate.