From 71daa3cc1401c8f1564755e34b08ed07ecfef620 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Fri, 28 Jan 2022 15:03:13 +0100 Subject: Run with 20% of cores at lowest priority. --- .../profile/compiled/CompiledQueryProfileRegistry.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'container-search') diff --git a/container-search/src/main/java/com/yahoo/search/query/profile/compiled/CompiledQueryProfileRegistry.java b/container-search/src/main/java/com/yahoo/search/query/profile/compiled/CompiledQueryProfileRegistry.java index 29a383f8896..72b489e3ca9 100644 --- a/container-search/src/main/java/com/yahoo/search/query/profile/compiled/CompiledQueryProfileRegistry.java +++ b/container-search/src/main/java/com/yahoo/search/query/profile/compiled/CompiledQueryProfileRegistry.java @@ -32,7 +32,7 @@ public class CompiledQueryProfileRegistry extends ComponentRegistry doneQ = new LinkedBlockingQueue<>(); int started = 0; int completed = 0; @@ -43,7 +43,16 @@ public class CompiledQueryProfileRegistry extends ComponentRegistry doneQ.add(QueryProfileCompiler.compile(inputProfile, this))); + executor.execute(() -> { + Thread self = Thread.currentThread(); + int prevPriority = self.getPriority(); + try { + self.setPriority(Thread.MIN_PRIORITY); + doneQ.add(QueryProfileCompiler.compile(inputProfile, this)); + } finally { + self.setPriority(prevPriority); + } + }); } while (completed < started) { register(doneQ.take()); -- cgit v1.2.3