Skip to content

Comments

Solves problems with expensive inlinestats benchmarks#896

Merged
ncordon merged 6 commits intoelastic:masterfrom
ncordon:reduce-inline-stats-benchmarks
Oct 31, 2025
Merged

Solves problems with expensive inlinestats benchmarks#896
ncordon merged 6 commits intoelastic:masterfrom
ncordon:reduce-inline-stats-benchmarks

Conversation

@ncordon
Copy link
Contributor

@ncordon ncordon commented Oct 30, 2025

Adds a smaller index nyc_taxis_sample with a 1000 rows of the original nyc_taxis and runs the benchmarks stats_count_group_by_esql and inlinestats_count_group_by_esql on it.

Why

Because there are some benchmarks for inline stats that are triggering circuit breaker exceptions:

esrally.exceptions.RallyError: Cannot run task [stats_count_group_by_esql]: Request returned an error. Error type: api, Description: {"error":{"root_cause":[{"type":"circuit_breaking_exception","reason":"[request] 

Data too large, data for [<reused_arrays>] would be [5153974035/4.8gb], which is larger than the limit of [5153960755/4.7gb]; 
for more information, see https://www.elastic.co/docs/troubleshoot/elasticsearch/circuit-breaker-errors?version=master","bytes_wanted":5153974035,"bytes_limit":5153960755,"durability":"TRANSIENT","suppressed":[{"type":"circuit_breaking_exception","reason":"[request] 

Data too large, data for [<reused_arrays>] would be [5153974035/4.8gb], which is larger than the limit of [5153960755/4.7gb];

@ncordon ncordon force-pushed the reduce-inline-stats-benchmarks branch from 57ddf24 to 4fc5adc Compare October 31, 2025 08:55
"name": "stats_count_group_by_esql",
"operation-type": "esql",
"query" : "FROM nyc_taxis METADATA _id | stats count(passenger_count) by _id | LIMIT 1000"
"query" : "FROM nyc_taxis_sample METADATA _id | stats count(passenger_count) by _id"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note the LIMIT 1000 was moved after the queries in this other pr: #873

Copy link
Contributor

Choose a reason for hiding this comment

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

Having the limit before or after the stats completely changes the behaviour of the query. The other PR moved it after, and this one effectively moves it before again. I'm assuming we will see performance differences with both changes?

Copy link
Contributor

Choose a reason for hiding this comment

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

Having said that, I understand the purpose of these queries was to limit before, so the change in this current PR is moving back towards that original purpose.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The queries haven't even run after we changed the limit to be after, right? So we should be able to revert to the original purpose of these benchmarks that was to evaluate the inline stats more than the fetching part

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point!

Copy link
Contributor

@craigtaverner craigtaverner left a comment

Choose a reason for hiding this comment

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

Approved, although I wonder if there are pre-existing operations that could be used. At least for deleting the index, I assume there exists a delete-index operation. For the sampling of the index, I doubt there exists an operation for that, so the raw-operation is probably necessary. Would be interesting to get an opinion from es-perf about this.

"body": {
"source": {
"index": "nyc_taxis",
"query": { "match_all": {} }
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need a query here, isn't match_all implied?

Copy link
Contributor

Choose a reason for hiding this comment

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

I assumed you had two ways of doing this, one with a query, and include a size inside that, and the other with the max_docs parameter. Since you used max_docs, I presumed the query was unnecessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah you are right, I thought we still needed the query 👍

},
{
"name": "delete-nyc-taxis-sample-index",
"operation-type": "raw-request",
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't there already a delete index operation you could use instead of a raw-request?

Copy link
Contributor

Choose a reason for hiding this comment

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

"name": "stats_count_group_by_esql",
"operation-type": "esql",
"query" : "FROM nyc_taxis METADATA _id | stats count(passenger_count) by _id | LIMIT 1000"
"query" : "FROM nyc_taxis_sample METADATA _id | stats count(passenger_count) by _id"
Copy link
Contributor

Choose a reason for hiding this comment

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

Having the limit before or after the stats completely changes the behaviour of the query. The other PR moved it after, and this one effectively moves it before again. I'm assuming we will see performance differences with both changes?

"name": "stats_count_group_by_esql",
"operation-type": "esql",
"query" : "FROM nyc_taxis METADATA _id | stats count(passenger_count) by _id | LIMIT 1000"
"query" : "FROM nyc_taxis_sample METADATA _id | stats count(passenger_count) by _id"
Copy link
Contributor

Choose a reason for hiding this comment

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

Having said that, I understand the purpose of these queries was to limit before, so the change in this current PR is moving back towards that original purpose.

@gbanasiak gbanasiak requested a review from a team October 31, 2025 10:51
Copy link
Contributor

@gbanasiak gbanasiak left a comment

Choose a reason for hiding this comment

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

The reindexing approach with document limit does not guarantee the same set of documents in nyc_taxis_sample on each run which may or may not contribute to variability of the benchmark depending on uniformity of the corpus. A conservative approach would be hand-picking 1000 documents, creating a new corpus file, and defining a new index in corpora. Something to consider if results are more noisy than before.

Please see other comments below.

@ncordon ncordon force-pushed the reduce-inline-stats-benchmarks branch from d7d6ee1 to c5ee865 Compare October 31, 2025 15:32
@ncordon ncordon merged commit 8209244 into elastic:master Oct 31, 2025
28 checks passed
@esbenchmachine esbenchmachine added the backport pending Awaiting backport to stable release branch label Oct 31, 2025
@gbanasiak
Copy link
Contributor

backported to 9.2 in #919

@gbanasiak gbanasiak added v9.2 and removed backport pending Awaiting backport to stable release branch labels Nov 20, 2025
@elastic elastic deleted a comment from esbenchmachine Nov 21, 2025
@esbenchmachine esbenchmachine mentioned this pull request Dec 3, 2025
gbanasiak added a commit that referenced this pull request Dec 3, 2025
This is an empty commit which records missing backports from manual
or squashed backports through "cherry picked from" metadata.

CI determines Elasticsearch build arguments #925 (#926)
(cherry picked from commit 8c33ff5)

Exclude some challenges when testing with ES release builds #922 (#919)
(cherry picked from commit f38f8fc)

Reduce filtering scope in CI workflow #908 (#919)
(cherry picked from commit 8e571a5)

Address pytest deprecations #911 (#919)
(cherry picked from commit fa81c5e)

Solves problems with expensive inlinestats benchmarks #896 (#919)
(cherry picked from commit 8209244)

Adds better challenges for comparing inlinestats #873 (#919)
(cherry picked from commit c41a950)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants