Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[branch/v8] Stop loading the enitre node set into memory per tsh ssh connection (#12014) #12571

Merged
merged 1 commit into from
May 11, 2022

Conversation

rosstimothy
Copy link
Contributor

Backport

This will backport the following commits from master to branch/v8:

Questions ?

Please refer to the Backport tool documentation

…12014)

* Prevent proxy from loading entire node set into memory more than once

When establishing a new session to a node, the proxy would load the
entire node set into memory in an attempt to find the matching host. For
smaller clusters this may not be that problematic. But on larger clusters,
loading >40k nodes into memory from the cache can be quite expensive.
This problem is compounded by the fact that it happened**per** session,
which could potentially cause the proxy to consume all available memory
and be OOM killed.

A new `NodeWatcher` is introduced which will maintain an in memory list
of all nodes per process. The watcher leverages the existing resource
watcher system and stores all nodes as types.Server, to eliminate the
cost incurred by unmarshalling the nodes from the cache. The `NodeWatcher`
provides a way to retrieve a filtered list of nodes in order to reduce the number
of copies made to only the matches.

(cherry picked from commit fa12352)
@rosstimothy rosstimothy force-pushed the backport/branch/v8/pr-12014 branch from d20a4bf to 33a9fb2 Compare May 11, 2022 16:03
@rosstimothy rosstimothy enabled auto-merge (squash) May 11, 2022 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants