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

Speed up synthetic source again #89600

Merged
merged 2 commits into from
Aug 26, 2022

Conversation

nik9000
Copy link
Member

@nik9000 nik9000 commented Aug 24, 2022

When I added support for stored fields to synthetic _source (#87480) I
accidentally caused a performance regression. Our friends working on
building the nightly charts for tsdb caught it. It looked like:
image

on my laptop that recreates to something like:

|   50th percentile latency | default_1k | 20.1228 | 41.289  | 21.1662  | ms | +105.18% |
|   90th percentile latency | default_1k | 26.7402 | 42.5878 | 15.8476  | ms |  +59.27% |
|   99th percentile latency | default_1k | 37.0881 | 45.586  |  8.49786 | ms |  +22.91% |
| 99.9th percentile latency | default_1k | 43.7346 | 48.222  |  4.48742 | ms |  +10.26% |
|  100th percentile latency | default_1k | 46.057  | 56.8676 | 10.8106  | ms |  +23.47% |

This fixes the regression and puts us in line with how we were:

|   50th percentile latency | default_1k | 20.1228 | 24.023  |  3.90022 | ms |  +19.38% |
|   90th percentile latency | default_1k | 26.7402 | 29.7841 |  3.04392 | ms |  +11.38% |
|   99th percentile latency | default_1k | 37.0881 | 36.8038 | -0.28428 | ms |   -0.77% |
| 99.9th percentile latency | default_1k | 43.7346 | 39.0192 | -4.71531 | ms |  -10.78% |
|  100th percentile latency | default_1k | 46.057  | 42.9181 | -3.13889 | ms |   -6.82% |

A 20% bump in the 50% latency isn't great, but it four microseconds per
document which is acceptable.

@nik9000 nik9000 marked this pull request as draft August 24, 2022 18:42
@nik9000
Copy link
Member Author

nik9000 commented Aug 24, 2022

Flipping to draft while I find a unit test I can add.

When I added support for stored fields to synthetic _source (elastic#87480) I
accidentally caused a performance regression. Our friends working on
building the nightly charts for tsdb caught it. It looked like:
```
|   50th percentile latency | default_1k | 20.1228 | 41.289  | 21.1662  | ms | +105.18% |
|   90th percentile latency | default_1k | 26.7402 | 42.5878 | 15.8476  | ms |  +59.27% |
|   99th percentile latency | default_1k | 37.0881 | 45.586  |  8.49786 | ms |  +22.91% |
| 99.9th percentile latency | default_1k | 43.7346 | 48.222  |  4.48742 | ms |  +10.26% |
|  100th percentile latency | default_1k | 46.057  | 56.8676 | 10.8106  | ms |  +23.47% |
```

This fixes the regression and puts us in line with how we were:
```
|   50th percentile latency | default_1k | 20.1228 | 24.023  |  3.90022 | ms |  +19.38% |
|   90th percentile latency | default_1k | 26.7402 | 29.7841 |  3.04392 | ms |  +11.38% |
|   99th percentile latency | default_1k | 37.0881 | 36.8038 | -0.28428 | ms |   -0.77% |
| 99.9th percentile latency | default_1k | 43.7346 | 39.0192 | -4.71531 | ms |  -10.78% |
|  100th percentile latency | default_1k | 46.057  | 42.9181 | -3.13889 | ms |   -6.82% |
```

A 20% bump in the 50% latency isn't great, but it four microseconds per
document which is acceptable.
Copy link
Contributor

@romseygeek romseygeek left a comment

Choose a reason for hiding this comment

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

LGTM

@nik9000
Copy link
Member Author

nik9000 commented Aug 24, 2022

Oh! I found some fun bugs!

@nik9000
Copy link
Member Author

nik9000 commented Aug 24, 2022

Yeah! There's a problem with empty values. But I think I can work it out. Well, I think I have. But running more tests.

@nik9000
Copy link
Member Author

nik9000 commented Aug 25, 2022

I pushed an update that fixes the tests and I think that fixes it an the perf is still ok:

|   50th percentile latency | default_1k | 20.1228 | 24.5791 |  4.45623 | ms | +22.15% |
|   90th percentile latency | default_1k | 26.7402 | 28.1429 |  1.40277 | ms |  +5.25% |
|   99th percentile latency | default_1k | 37.0881 | 36.3175 | -0.7706  | ms |  -2.08% |
| 99.9th percentile latency | default_1k | 43.7346 | 44.9435 |  1.20893 | ms |  +2.76% |
|  100th percentile latency | default_1k | 46.057  | 46.8294 |  0.77246 | ms |  +1.68% |

@nik9000 nik9000 marked this pull request as ready for review August 25, 2022 14:03
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Aug 25, 2022
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo (Team:Analytics)

@nik9000 nik9000 merged commit 6f5fa14 into elastic:main Aug 26, 2022
@nik9000
Copy link
Member Author

nik9000 commented Aug 26, 2022

Thanks @romseygeek !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>non-issue :StorageEngine/TSDB You know, for Metrics Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants