-
Notifications
You must be signed in to change notification settings - Fork 285
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
Xapi thread classification - part 2 #6154
base: feature/perf
Are you sure you want to change the base?
Xapi thread classification - part 2 #6154
Conversation
Adds more granurality in the xapi thread classification. Now, an individual thread can be mapped to the following: - {xapi_cgroup}/internal/SM; - {xapi_cgroup}/internal/cli; - {xapi_cgroup}/external/intrapool; - {xapi_cgroup}/external/unauthenticated; - {xapi_cgroup}/external/authenticated/{identity}; where {identity} is a {auth_user_sid}/{user_agent}. Both {auth_user_sid} and {user_agent} strings are sanitized when making the identity through `Identity.make`, by allowing only alphanumenric characters and a maximum length of 16 characters each. This is only the library change. This should allow for proper thread classification in xapi. Signed-off-by: Gabriel Buica <[email protected]>
fc0da95
to
90b296c
Compare
Adds unit test for: - the correct thread classification of `of_creator`; - sanitation of `Identity.make`. Signed-off-by: Gabriel Buica <[email protected]>
Classifies the threads at the time of session creation and inside `do_dispatch`. This ensures that new threads created by current session/request inherit the propper classification. Note: threads created by xenopsd calling back into xapi are yet to be classified. Signed-off-by: Gabriel Buica <[email protected]>
f91bdb1
to
62a903a
Compare
|> Option.map sanitize | ||
|> Option.map (fun user_agent -> | ||
let len = Int.min (String.length user_agent) 16 in | ||
String.sub user_agent 0 len |
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.
Do we have to care about collisions? If we consider only the sanitized prefix, we could end up with collisions of the shortened names.
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.
I don't think collisions matter that much in this case. If the we end up with the same shortened names they should be under the same classification. The important aspect was to differentiate between auth_user_sid
s.
Adds more granurality in the xapi thread classification. Now, an
individual thread can be mapped to the following:
where {identity} is a {auth_user_sid}/{user_agent}.
Both {auth_user_sid} and {user_agent} strings are sanitized when
making the identity through
Identity.make
, by allowing onlyalphanumeric characters and a maximum length of 16 characters each.
This should allow for proper thread classification in xapi.
Note: Threads calling back into xapi from xenopsd are yet to be classified.
e.g. Cgroup hierarchy based on the new classification
BVT: 208947 & BST: 208972