-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Host user creation - Only update groups if needed #44991
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - thanks for including some performance measurements. Definitely looks like it makes a big difference!
Friendly ping @fspmarshall |
Friendly ping @fspmarshall @rosstimothy |
I'm working on a benchmark test to cover the case that identified this regression. Below is the comparison from running it on master and running it on this branch. benchstat old.txt new.txt
goos: linux
goarch: arm64
pkg: github.com/gravitational/teleport/lib/srv/regular
│ old.txt │ new.txt │
│ sec/op │ sec/op vs base │
ExecCommand/no_user_creation-8 340.5m ± 17% 338.5m ± 10% ~ (p=0.579 n=10)
ExecCommand/with_user_creation-8 50110.2m ± 110% 289.5m ± 20% -99.42% (p=0.000 n=10)
geomean 4.131 313.0m -92.42% |
Regression originally introduced by #41919 |
This change updates host user creation to only update a host user's groups when they have changed (in the role). This allows nodes to skip acquiring a user lock most of the time, which fixes performance issues when a Teleport user
exec
s repeatedly.Benchmarks from running
tsh ssh
5 times concurrently are below.Before:
seq 5 | parallel tsh ssh -l keeptemp node echo
After:
seq 5 | parallel tsh ssh -l keeptemp node echo
Changelog: Improved tsh ssh performance for concurrent execs