Skip to content

Commit

Permalink
Track ongoing search tasks (elastic#107129)
Browse files Browse the repository at this point in the history
  • Loading branch information
JVerwolf authored Apr 8, 2024
1 parent ab52ef1 commit 073048a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
5 changes: 5 additions & 0 deletions docs/changelog/107129.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 107129
summary: Track ongoing search tasks
area: Search
type: enhancement
issues: []
18 changes: 16 additions & 2 deletions server/src/main/java/org/elasticsearch/threadpool/ThreadPool.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ public static ThreadPoolType fromType(String type) {
entry(Names.SYSTEM_CRITICAL_WRITE, ThreadPoolType.FIXED)
);

public static final double searchAutoscalingEWMA = 0.1;

private final Map<String, ExecutorHolder> executors;

private final ThreadPoolInfo threadPoolInfo;
Expand Down Expand Up @@ -222,15 +224,27 @@ public ThreadPool(final Settings settings, MeterRegistry meterRegistry, final Ex
builders.put(Names.ANALYZE, new FixedExecutorBuilder(settings, Names.ANALYZE, 1, 16, TaskTrackingConfig.DO_NOT_TRACK));
builders.put(
Names.SEARCH,
new FixedExecutorBuilder(settings, Names.SEARCH, searchOrGetThreadPoolSize, 1000, TaskTrackingConfig.DEFAULT)
new FixedExecutorBuilder(
settings,
Names.SEARCH,
searchOrGetThreadPoolSize,
1000,
new TaskTrackingConfig(true, searchAutoscalingEWMA)
)
);
builders.put(
Names.SEARCH_WORKER,
new FixedExecutorBuilder(settings, Names.SEARCH_WORKER, searchOrGetThreadPoolSize, -1, TaskTrackingConfig.DEFAULT)
);
builders.put(
Names.SEARCH_COORDINATION,
new FixedExecutorBuilder(settings, Names.SEARCH_COORDINATION, halfProc, 1000, TaskTrackingConfig.DEFAULT)
new FixedExecutorBuilder(
settings,
Names.SEARCH_COORDINATION,
halfProc,
1000,
new TaskTrackingConfig(true, searchAutoscalingEWMA)
)
);
builders.put(
Names.AUTO_COMPLETE,
Expand Down

0 comments on commit 073048a

Please sign in to comment.