JRob
10/01/2025, 1:39 PMKyle Hoondert
10/01/2025, 1:48 PMJohn Kowtko
10/01/2025, 3:10 PMMaytas Monsereenusorn
10/01/2025, 8:42 PMJRob
10/02/2025, 3:45 PMJRob
10/02/2025, 3:49 PMpriority matter when hilo is used? Should I also be decrementing the priority using druid.query.scheduler.prioritization.adjustment ?John Kowtko
10/03/2025, 1:17 AMMaytas Monsereenusorn
10/03/2025, 3:14 AMMaytas Monsereenusorn
10/03/2025, 3:14 AMJRob
10/03/2025, 1:38 PMdruid.query.scheduler.prioritization.adjustment is none. However, the hilo strategy still moves large queries into the "low" lane. So it looks like priority is ignore with hilo strategy?
I guess my question is should I also be using adjustment with hilo or will the default of none work all the same?JRob
10/03/2025, 1:44 PMJRob
10/07/2025, 3:25 PMMaytas Monsereenusorn
10/07/2025, 6:47 PMThe defaultisdruid.query.scheduler.prioritization.adjustment. However, thenonestrategy still moves large queries into the “low” lane. So it looks like priority is ignore withhilostrategy?hilo
I guess my question is should I also be usingThere are two strategies here. One is for prioritization strategy, druid.query.scheduler.prioritization.strategy. This is how the priority is adjusted and the other one is for Laning strategies, druid.query.scheduler.laning.strategy. This is how Druid creates/maintains lane for query on the broker. druid.query.scheduler.prioritization.adjustment is related to the prioritization strategy and hilo is related to the Laning strategies. They are kinda different thingswithadjustmentor will the default ofhilowork all the same?none
Maytas Monsereenusorn
10/07/2025, 6:49 PMI understand there’s no preempting but what about large queries that request a large number of segments? Will higher priority requests jump in between?
For example, I have two requests; a low priority one needs to open ~72,000 segment files and a high priority one that needs to open 10 segment files. The low priority one executes first. Will the high priority request be blocked until all 72,000 segment files are processed by the lower priority request or is there an opportunity to jump the queue?higher priority requests jumps to the front of the queue (I think). If each of the individual segment processing for the large query is slow, then the higher priority requests will have to wait for that
Maytas Monsereenusorn
10/07/2025, 6:49 PMJRob
10/07/2025, 8:08 PMJRob
10/14/2025, 9:15 PMdruid.query.scheduler.prioritization.adjustment I discovered that the default value is 5.JRob
10/15/2025, 4:10 PM# Query prioritization and laning
druid.query.scheduler.numThreads=50
druid.query.scheduler.prioritization.strategy=threshold
druid.query.scheduler.prioritization.segmentCountThreshold=200
druid.query.scheduler.prioritization.adjustment=5
Test parameters:
• Heavy query is defined as > 200 segments and typically taking ~20 seconds to execute
• Light query is defined as < 10 segments and typically taking ~0.2 seconds to execute
Test A
-------
I execute 5 heavy and 3 light queries in sequence, about 1 second apart.
Query Response Times (without threshold config):
1. 18.80s
2. 29.00s
3. 38.75s
4. 50.19s
5. 50.86s
6. 12.48s (light query)
7. 18.73s (light query)
8. 21.01s (light query)
9. Average heavy query: 38s
10. Average light query: 17s
Query Response Times With Threshold Config:
1. 19.60s
2. 27.84s
3. 36.92s
4. 46.18s
5. 45.54s
6. 12.87s (light query)
7. 11.82s (light query)
8. 10.86s (light query)
9. Average heavy query: 35s
10. Average light query: 12s
Executed several times in a row I get fairly consistent results with the above. It's obvious how much the impact heavy queries have on lighter queries. That said, taking into account some variation for execution times, the threshold parameters reduce the query times by about 5 seconds which is 40% faster than without threshold prioritization strategy.
Test B
-------
I execute 4 heavy and 4 light queries alternating. Again in sequence, about 1 second apart.
Query Response Times (without threshold config):
1. 18.58s
2. 7.72s (light query)
3. 24.85s
4. 14.67s (light query)
5. 31.48s
6. 12.34s (light query)
7. 30.15s
8. 17.61s (light query)
9. Average heavy query: 26s
10. Average light query: 13s
Query Response Times With Threshold Config:
1. 20.02s
2. 1.75s (light query)
3. 28.93s
4. 1.11s (light query)
5. 35.61s
6. 0.95s (light query)
7. 33.98s
8. 0.68s (light query)
9. Average heavy query: 30s
10. Average light query: 4s
Conclusion: The threshold configuration allows the lighter queries to respond closer to their typical response times, as long is there aren't too many heavy queries executing close ahead of them. I'm interested to see how this behaves in a production environment with mixed workload.