You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the agent checkin we are doing a query to get AgentActions saved objects and this query use KQL. After some CPU profile (see screenshot below) it seems that is really inefficient as SO client parse the KQL query each time and this operation is CPU intensive.
During a 20s, CPU profile of 2000 agents enrolled we passed 1.2 seconds for parsing KQL queries
Potential solutions
Fix KQL perfomance
Can we make the saved object filter option faster? implement some caching? (we use dynamic KQL, so it could be hard to cache) @kobelb curious to have your thoughts on that.
Change our data model
Currently we rely on a property on the AgentAction, sent_at to know if is an action has been sent to the agent, we can change our data model, to add the actions to send to the agent saved object something like
Description
In the agent checkin we are doing a query to get
AgentActions
saved objects and this query use KQL. After some CPU profile (see screenshot below) it seems that is really inefficient as SO client parse the KQL query each time and this operation is CPU intensive.The search query https://github.com/elastic/kibana/blob/master/x-pack/plugins/ingest_manager/server/services/agents/actions.ts/#L34
During a 20s, CPU profile of 2000 agents enrolled we passed 1.2 seconds for parsing KQL queries
Potential solutions
Fix KQL perfomance
Can we make the saved object filter option faster? implement some caching? (we use dynamic KQL, so it could be hard to cache) @kobelb curious to have your thoughts on that.
Change our data model
Currently we rely on a property on the
AgentAction
,sent_at
to know if is an action has been sent to the agent, we can change our data model, to add the actions to send to the agent saved object something likeand the checkin will be
Warning: we can potentially have race conditions when adding/removing actions
actions_to_send
The text was updated successfully, but these errors were encountered: