Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate fixed_auto_queue_size thread pool type #52399

Merged
merged 3 commits into from
Feb 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions docs/reference/modules/threadpool.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ There are several thread pools, but the important ones include:
`1000`.

[[search-throttled]]`search_throttled`::
For count/search/suggest/get operations on `search_throttled indices`.
Thread pool type is `fixed_auto_queue_size` with a size of `1`, and initial
For count/search/suggest/get operations on `search_throttled indices`.
Thread pool type is `fixed_auto_queue_size` with a size of `1`, and initial
queue_size of `100`.

`get`::
Expand All @@ -30,7 +30,7 @@ There are several thread pools, but the important ones include:
queue_size of `1000`.

`analyze`::
For analyze requests. Thread pool type is `fixed` with a size of `1`, queue
For analyze requests. Thread pool type is `fixed` with a size of `1`, queue
size of `16`.

`write`::
Expand All @@ -51,8 +51,8 @@ There are several thread pools, but the important ones include:
keep-alive of `5m` and a max of `min(10, (# of available processors)/2)`.

`listener`::
Mainly for java client executing of action when listener threaded is set to
`true`. Thread pool type is `scaling` with a default max of
Mainly for java client executing of action when listener threaded is set to
`true`. Thread pool type is `scaling` with a default max of
`min(10, (# of available processors)/2)`.

`fetch_shard_started`::
Expand Down Expand Up @@ -125,6 +125,9 @@ thread_pool:

experimental[]

deprecated[7.7.0,The experimental `fixed_auto_queue_size` thread pool type is
deprecated and will be removed in 8.0.]

The `fixed_auto_queue_size` thread pool holds a fixed size of threads to handle
the requests with a bounded queue for pending requests that have no threads to
service them. It's similar to the `fixed` threadpool, however, the `queue_size`
Expand Down Expand Up @@ -202,13 +205,13 @@ processors: 2
There are a few use-cases for explicitly overriding the `processors`
setting:

. If you are running multiple instances of {es} on the same host but want {es}
to size its thread pools as if it only has a fraction of the CPU, you should
override the `processors` setting to the desired fraction, for example, if
. If you are running multiple instances of {es} on the same host but want {es}
to size its thread pools as if it only has a fraction of the CPU, you should
override the `processors` setting to the desired fraction, for example, if
you're running two instances of {es} on a 16-core machine, set `processors` to 8.
Note that this is an expert-level use case and there's a lot more involved
than just setting the `processors` setting as there are other considerations
like changing the number of garbage collector threads, pinning processes to
Note that this is an expert-level use case and there's a lot more involved
than just setting the `processors` setting as there are other considerations
like changing the number of garbage collector threads, pinning processes to
cores, and so on.
. Sometimes the number of processors is wrongly detected and in such
cases explicitly setting the `processors` setting will workaround such
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@ public final class AutoQueueAdjustingExecutorBuilder extends ExecutorBuilder<Aut
final String frameSizeKey = settingsKey(prefix, "auto_queue_frame_size");
final String targetedResponseTimeKey = settingsKey(prefix, "target_response_time");
this.targetedResponseTimeSetting = Setting.timeSetting(targetedResponseTimeKey, TimeValue.timeValueSeconds(1),
TimeValue.timeValueMillis(10), Setting.Property.NodeScope);
TimeValue.timeValueMillis(10), Setting.Property.NodeScope, Setting.Property.Deprecated);
this.queueSizeSetting = Setting.intSetting(queueSizeKey, initialQueueSize, Setting.Property.NodeScope);
// These temp settings are used to validate the min and max settings below
Setting<Integer> tempMaxQueueSizeSetting = Setting.intSetting(maxSizeKey, maxQueueSize, Setting.Property.NodeScope);
Setting<Integer> tempMinQueueSizeSetting = Setting.intSetting(minSizeKey, minQueueSize, Setting.Property.NodeScope);
Setting<Integer> tempMaxQueueSizeSetting = Setting.intSetting(maxSizeKey, maxQueueSize, Setting.Property.NodeScope,
Setting.Property.Deprecated);
Setting<Integer> tempMinQueueSizeSetting = Setting.intSetting(minSizeKey, minQueueSize, Setting.Property.NodeScope,
Setting.Property.Deprecated);

this.minQueueSizeSetting = new Setting<>(
minSizeKey,
Expand Down Expand Up @@ -126,8 +128,9 @@ public Iterator<Setting<?>> settings() {
}

},
Setting.Property.NodeScope);
this.frameSizeSetting = Setting.intSetting(frameSizeKey, frameSize, 100, Setting.Property.NodeScope);
Setting.Property.NodeScope, Setting.Property.Deprecated);
this.frameSizeSetting = Setting.intSetting(frameSizeKey, frameSize, 100, Setting.Property.NodeScope, Setting.Property.Deprecated,
Setting.Property.Deprecated);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ public void testValidatingMinMaxSettings() {
} catch (IllegalArgumentException e) {
assertEquals(e.getMessage(), "Failed to parse value [100] for setting [thread_pool.test.min_queue_size] must be <= 99");
}

assertSettingDeprecationsAndWarnings(new String[]{"thread_pool.test.max_queue_size"});
}

public void testSetLowerSettings() {
Expand All @@ -89,6 +91,8 @@ public void testSetLowerSettings() {
AutoQueueAdjustingExecutorBuilder.AutoExecutorSettings s = test.getSettings(settings);
assertEquals(10, s.maxQueueSize);
assertEquals(10, s.minQueueSize);

assertSettingDeprecationsAndWarnings(new String[]{"thread_pool.test.min_queue_size", "thread_pool.test.max_queue_size"});
}

public void testSetHigherSettings() {
Expand All @@ -100,6 +104,8 @@ public void testSetHigherSettings() {
AutoQueueAdjustingExecutorBuilder.AutoExecutorSettings s = test.getSettings(settings);
assertEquals(3000, s.maxQueueSize);
assertEquals(2000, s.minQueueSize);

assertSettingDeprecationsAndWarnings(new String[]{"thread_pool.test.min_queue_size", "thread_pool.test.max_queue_size"});
}

}