Skip to content

Commit

Permalink
Change downsample threadpool size. (#97714) (#97764)
Browse files Browse the repository at this point in the history
Changed the downsample threadpool size to one eight of the allocated processors. Downsampling is a cpu intensive operation (search + heavy aggregation that rolls up documents) and could overwhelm a node. On top of this the downsample operation also delegates to force merge api, which has a threadpool that is also bounded to one eight of the allocated processors.

Relates to #97141
  • Loading branch information
martijnvg authored Jul 18, 2023
1 parent 9728d3d commit ff03c34
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ static int twiceAllocatedProcessors(final int allocatedProcessors) {
return boundedBy(2 * allocatedProcessors, 2, Integer.MAX_VALUE);
}

static int oneEighthAllocatedProcessors(final int allocatedProcessors) {
public static int oneEighthAllocatedProcessors(final int allocatedProcessors) {
return boundedBy(allocatedProcessors / 8, 1, Integer.MAX_VALUE);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public List<ExecutorBuilder<?>> getExecutorBuilders(Settings settingsToUse) {
final FixedExecutorBuilder downsample = new FixedExecutorBuilder(
settingsToUse,
Rollup.DOWSAMPLE_TASK_THREAD_POOL_NAME,
ThreadPool.searchOrGetThreadPoolSize(EsExecutors.allocatedProcessors(settingsToUse)),
ThreadPool.oneEighthAllocatedProcessors(EsExecutors.allocatedProcessors(settingsToUse)),
Rollup.DOWNSAMPLE_TASK_THREAD_POOL_QUEUE_SIZE,
"xpack.downsample.thread_pool",
false
Expand Down

0 comments on commit ff03c34

Please sign in to comment.