Skip to content

perf: Scope liveliness subscription by namespace to eliminate N² broa…#696

Open
cmeng-gao wants to merge 1 commit intoeclipse-zenoh:mainfrom
opkit:perf/namespace-scoped-liveliness
Open

perf: Scope liveliness subscription by namespace to eliminate N² broa…#696
cmeng-gao wants to merge 1 commit intoeclipse-zenoh:mainfrom
opkit:perf/namespace-scoped-liveliness

Conversation

@cmeng-gao
Copy link
Copy Markdown
Contributor

@cmeng-gao cmeng-gao commented Apr 27, 2026

Summary

  • When multiple bridges with different namespaces connect to the same router,
    each bridge subscribes to all liveliness tokens (@/*/@ros2_lv/**), causing
    O(N²) control plane overhead as the router forwards every token to every client.
  • Scope the liveliness subscription by namespace: bridges with a configured
    namespace (e.g., /bot1) now subscribe only to @/*/@ros2_lv/*/bot1§$*/**,
    leveraging the router's per-subscription interest matching to filter at the source.
  • Bridges with default namespace "/" retain the original wildcard subscription
    for backward compatibility.

Test plan

  • Deploy 2+ bridges with different namespaces connected to the same router
  • Verify each bridge only receives liveliness tokens for its own namespace
  • Verify bridge with default namespace "/" still receives all tokens
  • Monitor router control plane traffic to confirm reduced forwarding

…dcast

When multiple bridges with different namespaces connect to the same
router, each bridge was subscribing to all liveliness tokens
(@/*/@ros2_lv/**), causing O(N²) control plane overhead as the router
forwarded every token to every client.

Now, bridges with a configured namespace subscribe only to tokens
matching their namespace prefix (e.g., @/*/@ros2_lv/*/ns1§$*/**),
leveraging the router's per-subscription interest matching to filter
at the source. Bridges with default namespace "/" retain the original
behavior for backward compatibility.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cmeng-gao
Copy link
Copy Markdown
Contributor Author

@JEnoch

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.

1 participant