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

[ML] improve trained model stats API performance #87978

Merged

Conversation

benwtrent
Copy link
Member

Previous, get trained model stats API would build every pipeline defined in cluster state.

This is problematic when MANY pipelines are defined. Especially if those pipelines take some time to parse (consider GROK).

This improvement is part of fixing: #87931

@benwtrent benwtrent added >bug :ml Machine learning v8.4.0 labels Jun 23, 2022
@elasticsearchmachine
Copy link
Collaborator

Hi @benwtrent, I've created a changelog YAML for you.

@elasticmachine elasticmachine added the Team:ML Meta label for the ML team label Jun 23, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

@benwtrent
Copy link
Member Author

Reviewer, issue #87931 is focused on making the API cancellable.

I will do that in a separate PR to reduce the review space and code churn :).

@benwtrent
Copy link
Member Author

@elasticmachine update branch

@droberts195
Copy link
Contributor

I know we have a report saying that this got slow after upgrading from 7.17 to 8.x, but I cannot see why this couldn't have been just as slow in 7.17 assuming the same ingest pipelines existed.

Is there a good explanation for why the 7.17 get trained model stats code would not have suffered from the problem of slow Grok processor instantiation? If there isn't then I think this fix should be backported to 7.17.6 (and 8.3.1 too, to get it out to 8.x users sooner).

@benwtrent
Copy link
Member Author

@droberts195 the only thing I can think of is that there may be more solutions/apps in Kibana and Elasticsearch making more "system managed" ingest pipelines in 8 vs 7. So, the increase in the number of pipelines pushed this over the edge.

Doing a quick search of any "grok" specific changes, indicates nothing that would make stuff incredibly slower.

It is true, any user with a large number of pipelines (especially complicated GROK ones), may run into this problem. I am good with backporting it to 7.17

Copy link
Contributor

@droberts195 droberts195 left a comment

Choose a reason for hiding this comment

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

LGTM apart from a couple of minor nits

@benwtrent
Copy link
Member Author

@elasticmachine update branch

@benwtrent
Copy link
Member Author

@elasticmachine update branch

@benwtrent
Copy link
Member Author

@elasticmachine update branch

@benwtrent benwtrent merged commit 6847c0b into elastic:master Jun 28, 2022
@benwtrent benwtrent deleted the feature/ml-fix-get-trained-model-stats branch June 28, 2022 12:38
benwtrent added a commit to benwtrent/elasticsearch that referenced this pull request Jun 28, 2022
Previous, get trained model stats API would build every pipeline defined in cluster state.

This is problematic when MANY pipelines are defined. Especially if those pipelines take some time to parse (consider GROK).

This improvement is part of fixing: elastic#87931
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
7.17 Commit could not be cherrypicked due to conflicts
8.3

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 87978

elasticsearchmachine pushed a commit that referenced this pull request Jun 28, 2022
Previous, get trained model stats API would build every pipeline defined in cluster state.

This is problematic when MANY pipelines are defined. Especially if those pipelines take some time to parse (consider GROK).

This improvement is part of fixing: #87931
benwtrent added a commit to benwtrent/elasticsearch that referenced this pull request Jun 28, 2022
Previous, get trained model stats API would build every pipeline defined in cluster state.

This is problematic when MANY pipelines are defined. Especially if those pipelines take some time to parse (consider GROK).

This improvement is part of fixing: elastic#87931
elasticsearchmachine pushed a commit that referenced this pull request Jun 28, 2022
Previous, get trained model stats API would build every pipeline defined in cluster state.

This is problematic when MANY pipelines are defined. Especially if those pipelines take some time to parse (consider GROK).

This improvement is part of fixing: #87931
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :ml Machine learning Team:ML Meta label for the ML team v7.17.5 v8.3.1 v8.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants