Repository navigation
Find a running client by type or by agent without looking at every client (CHOO-3667) - #1235
Closed
abeldantas wants to merge 1 commit into
Closed
abeldantas wants to merge 1 commit into
abeldantas wants to merge 1 commit into
Conversation
…ient (CHOO-3667) Every process keeps an actor for every client. Finding a workspace's admin (every room created asks) and the actor of an agent another process had just registered (a lookup that misses) read every actor. While 10,000 agents were being created, these lookups took about 11% of a process's CPU in a profile. The running clients are now indexed by type and tenant, and by agent (ClientLifecycleService._track and _forget). A lookup by agent that the index cannot answer looks only at the agents' clients whose agent row has not been seen yet.
abeldantas
requested review from
agent-runner353,
amaudruz,
christian-mcdermott,
lbangalosbt,
massimo-sandboxaq,
niall-sandboxaq,
petr-sandbox,
raullopez-sandbox and
simonflk-sb
as code owners
October 31, 2026 18:17
Collaborator
Author
|
Combined into #1307 with the other scaling PRs. |
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.
Every process keeps an actor for every client. Finding a workspace's admin, which every room created asks for, and the actor of an agent another process registered a moment before, read all of them. While 10,000 agents were being created, these lookups took about 11% of a process's CPU in a profile.
In this PR we index the running clients by type and tenant, and by agent (
ClientLifecycleService._trackand_forget). A lookup by agent that the index cannot answer looks only at the agents' clients whose agent row has not been seen yet.Stack (merge order)