apache / apache/druid

Virtual Thread Segment Processing Pool

Open
#18,733 7 comments 0 reactions 0 assignees View on GitHub
Feature/Change Description Performance
Dominant language
Java
Stars
14.1k
Forks
3.8k
Avg merge
2d 58m
Merged PRs (30d)
233

Description

### Description

Implement a virtual thread segment processing pool now that JDK 21 is supported. From my benchmarks, ≥ 30% of processing pool thread states are in WAITING state (blocked on I/O) on historical nodes and 80-90% of total individual segment processing time is spent waiting for available thread in the processing pool during spikes in QPS.

Virtual threads could benefit here as we can increase our processing concurrency without significant overhead.

Additionally, thoughts on having proper thread state accounting metrics? I'm thinking something like `jvm/thread/count` where dimensions are:
- `state`: the state the thread is in
- `pool`: the thread pool the thread belongs to

This will help with debugging performance issues.

### Motivation

This will reduce `query/wait/time` per-segment.

Contributor guide

Open the contributing guide

Research direction

No source file or test is named. Start by locating the segment processing pool and the code that records query/wait/time, then review how JDK 21 support is configured. Define completion around virtual-thread processing under QPS spikes and decide whether thread state metrics belong in the same change.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.