Skip to content

Commit

Permalink
Increase stateless refresh thread pool
Browse files Browse the repository at this point in the history
The refresh thread pool is sized too aggressively low for current
state of stateless, so increasing it.

Relates ES-7633 and ES-7631
  • Loading branch information
henningandersen committed Jan 12, 2024
1 parent 5d6b833 commit 956e1a5
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.io.stream.Writeable;
Expand Down Expand Up @@ -228,7 +229,9 @@ public ThreadPool(final Settings settings, final ExecutorBuilder<?>... customBui
new ScalingExecutorBuilder(Names.MANAGEMENT, 1, boundedBy(allocatedProcessors, 1, 5), TimeValue.timeValueMinutes(5), false)
);
builders.put(Names.FLUSH, new ScalingExecutorBuilder(Names.FLUSH, 1, halfProcMaxAt5, TimeValue.timeValueMinutes(5), false));
builders.put(Names.REFRESH, new ScalingExecutorBuilder(Names.REFRESH, 1, halfProcMaxAt10, TimeValue.timeValueMinutes(5), false));
// TODO: remove (or refine) this temporary stateless custom refresh pool sizing once ES-7631 is solved.
final int refreshThreads = DiscoveryNode.isStateless(settings) ? allocatedProcessors : halfProcMaxAt10;
builders.put(Names.REFRESH, new ScalingExecutorBuilder(Names.REFRESH, 1, refreshThreads, TimeValue.timeValueMinutes(5), false));
builders.put(Names.WARMER, new ScalingExecutorBuilder(Names.WARMER, 1, halfProcMaxAt5, TimeValue.timeValueMinutes(5), false));
final int maxSnapshotCores = getMaxSnapshotThreadPoolSize(allocatedProcessors);
builders.put(Names.SNAPSHOT, new ScalingExecutorBuilder(Names.SNAPSHOT, 1, maxSnapshotCores, TimeValue.timeValueMinutes(5), false));
Expand Down

0 comments on commit 956e1a5

Please sign in to comment.