apache / apache/druid

Querying Performance Degradation on Realtime Tasks

Open
#19,505 3 comments 0 reactions 0 assignees View on GitHub
Performance
Dominant language
Java
Stars
14.1k
Forks
3.8k
Avg merge
2d 58m
Merged PRs (30d)
233

Description

### Affected Version
Since v32

### Description

We are deploying our clusters using the MM-less Kubernetes extension. Recently, as we are upgrading our clusters from v27 to v37, we experienced a query degradation in `segmentMetadata` queries. We have yet to establish whether other query types are affected too.

#### Peon Querying Performance

- After upgrading to v37, performance degradation found when querying on realtime tasks.
- Currently, the cause is found on `segmentMetadata` queries, and the benchmark features `timeseries` queries... It might be possible for this issue to affect performance on other query types.
- Identified cause to be #15757, created to address memory load when serving `GroupBy` queries.
- While #17170 tried to mitigate the issue, the performance is still sub-optimal.

The following benchmark is done locally on `SinkQuerySegmentWalkerBenchmark`, measuing ms/op for differing number of hydrants per sink.

| | 10 | 50 | 100 | 200 |
| :----------------------------- | :---- | :---- | :---- | :---- |
| v27 | 0.089 | 0.162 | 0.265 | 0.493 |
| before-pr-15757 | 0.089 | 0.165 | 0.274 | 0.479 |
| after-pr-15757-before-pr-17170 | 0.519 | 2.351 | 4.847 | 9.112 |
| after-pr-17170 | 0.231 | 0.784 | 1.443 | 2.791 |
| v37 | 0.228 | 0.825 | 1.499 | 2.930 |

Additionally, there still appears to be a performance regression between #17170, which was included in v32, and v37. I have not yet identified the underlying cause, but this does suggest that we may benefit from introducing more systematic benchmarking for future PRs that could affect query or ingestion performance. This would help catch regressions earlier and provide a clearer basis for evaluating performance-sensitive changes.

Contributor guide

Open the contributing guide

Research direction

Start with SinkQuerySegmentWalkerBenchmark and the reported segmentMetadata and timeseries query results, then compare the v27, v32, and v37 behavior described here. Read the context from issues #15757 and #17170 before investigating the remaining regression. Done means the affected query paths and regression cause are established, with systematic benchmark coverage or a documented fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kubernetes
Domain
backend, databases, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.