Fix memory issues with caller rrd - #7201
Open
cplaursen wants to merge 3 commits into
Open
Conversation
Currently, the number of auto-registered callers is unbounded. This commit adds a default bound of 100, after which the caller which hasn't made a request in the longest time is evicted. The number can be configured with xapi.conf key "max-auto-registered-callers". Setting this number to 0 disables auto-registering, and setting it to a negative value removes the cap. Signed-off-by: Christian Pardillo Laursen <christian.pardillolaursen@citrix.com>
Registering every caller to the RRD is causing out-of-memory issues. We resolve this by only publishing groups rather than individual callers - this also allows users to define their own reporting groups based on their needs. Signed-off-by: Christian Pardillo Laursen <christian.pardillolaursen@citrix.com>
Signed-off-by: Christian Pardillo Laursen <christian.pardillolaursen@citrix.com>
changlei-li
reviewed
Jul 30, 2026
| ; pattern_key: Caller_table.Key.pattern_key | ||
| ; stats: Caller_statistics.t | ||
| ; rate_limit_ref: API.ref_Rate_limit | ||
| ; auto_registered: bool |
Contributor
There was a problem hiding this comment.
Do you think we should promote a auto_registered caller from true to false when admin links a rate_limit rule to it?
changlei-li
reviewed
Jul 30, 2026
| ~client_ip ~pattern_key = | ||
| ~client_ip ~pattern_key ~auto_registered = | ||
| match Caller_table.get_exact caller_table ~pattern:pattern_key with | ||
| | Some entry -> |
Contributor
There was a problem hiding this comment.
Same here. If admin creates caller matches a auto-registered caller, should change its auto_registered flag?
changlei-li
approved these changes
Jul 30, 2026
changlei-li
left a comment
Contributor
There was a problem hiding this comment.
A few nits for your reference.
| ( Rrd.Host | ||
| , Ds.ds_make | ||
| ~name:(Printf.sprintf "caller_%s_tokens" uuid) | ||
| ~name:(Printf.sprintf "group_%s_tokens" group) |
Contributor
There was a problem hiding this comment.
group name is passed by admin. Is it harmful in ds name if there is space, special characters or excessive length
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.
This PR addresses issues arising from unbounded, automatic caller registration and reporting of every caller in the following ways: