Repository navigation
isb 3.1.1: egress and metrics-history CPU fixes; inline tests don't count toward the file-size ratchet - #69
Merged
Merged
Conversation
The proxy manager polls plumb::list every 5 s. `GET /1.0/networks?recursion=1` makes incusd dump every host interface once per network it lists (22 on titan, so 23 full RTM_GETLINK dumps of 196 links per poll), to find bridges that are always named isbbrx<digest>. List names, then fetch only those. Claude-Session: https://claude.ai/code/session_01TxiqnSSTD6K8CmxmrsJrGR
The samples key starts with tier, so `WHERE sid = series.id` scanned the whole table once per series. Every minute the writer spent ~12 s at 100% on titan (11 s for exa alone: 139 series over 691k rows). Naming the tiers lets SQLite seek (tier, sid): 1 ms on the same data. Claude-Session: https://claude.ai/code/session_01TxiqnSSTD6K8CmxmrsJrGR
The limit is there to keep code legible. Counting `#[cfg(test)] mod` blocks meant a file near 1000 lines could only gain a test by losing coverage elsewhere. Budgets lowered to the new counts: notify/mod.rs, caddy.rs, machine.rs and audit.rs drop off the list. Claude-Session: https://claude.ai/code/session_01TxiqnSSTD6K8CmxmrsJrGR
# Conflicts: # Cargo.lock # Cargo.toml # docs/reference/rpc.md # sdk/python/pyproject.toml # sdk/python/src/isb/__init__.py # sdk/python/tests/test_unit.py # sdk/python/uv.lock # sdk/typescript/bun.lock # sdk/typescript/npm/linux-arm64/package.json # sdk/typescript/npm/linux-x64/package.json # sdk/typescript/package.json
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.
Two CPU fixes found while diagnosing incusd at ~300% CPU on titan, plus a ratchet change so tests never have to shrink to fit.
Egress listing (7bdd949). The egress manager polled
GET /1.0/networks?recursion=1every 5 s. incus 7.5.1 does a full host netlink link dump for each network in that listing (23 per poll on titan), to find zero egress bridges. It now lists names and GETs onlyisbbrx*bridges. Test:egress::plumb::tests::listing_fetches_only_egress_bridges(fails on the old code). The bigger incus-side cost, a host dump on every/stateand every filtered or recursive instance list, is upstream: lxc/incus#4249.Metrics-history prune (ec51363). Every 60 s,
OrgDb::maintaindeleted empty series withNOT EXISTS (SELECT 1 FROM samples WHERE sid = series.id). The samples key starts withtier, so SQLite scanned the whole table once per series. On titan theisb-metrics-historythread spent ~12 s at 100% every minute (exa alone: 139 series × 691k rows = 11.4 s). Naming the tiers lets it seek(tier, sid): 1 ms instead of 6.7 s on a copy of exa's database, deleting the same 46 series. Test:metrics_history::tests::maintain_prunes_empty_series_by_keyrunsmaintainover one series per tier plus an empty one, and checks the query plan. It fails on the old query and fails if a tier is left out.Ratchet (1a68a44). The 1000-line file limit no longer counts inline
#[cfg(test)] modblocks. Budgets are lowered to the new counts: notify/mod.rs, caddy.rs, machine.rs and audit.rs drop off the list.scripts/check.shpasses in a sandbox.https://claude.ai/code/session_01TxiqnSSTD6K8CmxmrsJrGR