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

[Ingest Manager] Rate limit agent config update #70871

Merged

Conversation

nchaulet
Copy link
Member

@nchaulet nchaulet commented Jul 6, 2020

Summary

Resolve #70250

Currently in a scenario with a lot of agents, updating an agent config cause Kibana to be not responsive.

Rate limit the creation of new agent config action to not block Kibana.

The rate limit is configurable using fleet.agentConfigRollupRateLimitIntervalMs and fleet.agentConfigRollupRateLimitRequestPerInterval config variables.

Tests

Locally I enrolled 2000 agents and triggered a config change, it's still causing a spike in the event loop, but Kibana is usable.

Before

Kibana was not responsive (not able to switch between kibana)
Screen Shot 2020-07-06 at 3 24 47 PM

After

Screen Shot 2020-07-06 at 3 25 32 PM

@nchaulet nchaulet added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.9.0 Team:Fleet Team label for Observability Data Collection Fleet team labels Jul 6, 2020
@nchaulet nchaulet self-assigned this Jul 6, 2020
@nchaulet nchaulet marked this pull request as ready for review July 6, 2020 20:16
@nchaulet nchaulet requested a review from a team July 6, 2020 20:16
@elasticmachine
Copy link
Contributor

Pinging @elastic/ingest-management (Team:Ingest Management)

Copy link
Contributor

@jfsiii jfsiii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I'm not experienced with rxjs specifically.

I think the improvements are reason enough to merge. We can benchmark, and improve further later.

@nchaulet
Copy link
Member Author

nchaulet commented Jul 7, 2020

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

Saved Objects .kibana field count

id value diff baseline
action 5 +5 -
action_task_params 3 +3 -
alert 22 +22 -
apm-indices 8 +8 -
apm-telemetry 238 +238 -
application_usage_transactional 2 +2 -
canvas-element 8 +8 -
canvas-workpad 5 +5 -
canvas-workpad-template 8 +8 -
cases 32 +32 -
cases-comments 17 +17 -
cases-configure 14 +14 -
cases-user-actions 10 +10 -
config 2 +2 -
dashboard 17 +17 -
endpoint:user-artifact 10 +10 -
endpoint:user-artifact-manifest 3 +3 -
epm-packages 8 +8 -
exception-list 35 +35 -
exception-list-agnostic 35 +35 -
file-upload-telemetry 2 +2 -
fleet-agent-actions 6 +6 -
fleet-agent-events 11 +11 -
fleet-agents 23 +23 -
fleet-enrollment-api-keys 10 +10 -
graph-workspace 9 +9 -
index-pattern 10 +10 -
infrastructure-ui-source 21 +21 -
ingest_manager_settings 5 +5 -
ingest-agent-configs 11 +11 -
ingest-outputs 10 +10 -
ingest-package-configs 35 +35 -
inventory-view 40 +40 -
kql-telemetry 3 +3 -
lens 7 +7 -
lens-ui-telemetry 5 +5 -
map 7 +7 -
metrics-explorer-view 22 +22 -
ml-telemetry 3 +3 -
namespace 1 +1 -
namespaces 1 +1 -
query 6 +6 -
references 4 +4 -
sample-data-telemetry 3 +3 -
search 9 +9 -
siem-detection-engine-rule-actions 8 +8 -
siem-detection-engine-rule-status 12 +12 -
siem-ui-timeline 86 +86 -
siem-ui-timeline-note 8 +8 -
siem-ui-timeline-pinned-event 7 +7 -
space 9 +9 -
telemetry 9 +9 -
timelion-sheet 13 +13 -
tsvb-validation-telemetry 2 +2 -
type 1 +1 -
ui-metric 2 +2 -
updated_at 1 +1 -
upgrade-assistant-reindex-operation 15 +15 -
upgrade-assistant-telemetry 13 +13 -
uptime-dynamic-settings 4 +4 -
url 6 +6 -
visualization 9 +9 -
total - +951 -

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@nchaulet nchaulet merged commit b1ec391 into elastic:master Jul 7, 2020
@nchaulet nchaulet deleted the feature-agent-config-rate-limit-rollup branch July 7, 2020 17:51
nchaulet added a commit to nchaulet/kibana that referenced this pull request Jul 7, 2020
@roncohen
Copy link
Contributor

roncohen commented Jul 8, 2020

Excited to try this out!
I think the config should be roll*out* and not "rollup"?

I see have both agentConfigRollupRateLimitRequestPerInterval and agentConfigRollupRateLimitIntervalMs.

I think the user doesn't mind too much what the agentConfigRollupRateLimitIntervalMs is. They'd want to set a limit per second, like "50/s". I suggest we hard code the interval to 1s and let the user set a simple frequency: "agentConfigRolloutRateLimit" or "agentConfigRolloutRateLimitPerSec"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v7.9.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Ingest Manager] Improve agent config rollout performance
5 participants