- Enclosing class:
ThreadPool
ThreadPool()
. The pools themselves are constructed
and configured using DefaultBuiltInExecutorBuilders
.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
A thread pool solely for the use of the cluster coordination subsystem that relates to cluster state updates, master elections, cluster membership and so on.static final String
static final String
static final String
static final String
static final String
A thread pool with a very high (but finite) maximum size.static final String
static final String
A thread pool for running tasks related to cluster management, including collecting and exposing stats in APIs and certain other internal tasks.static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
GENERIC
A thread pool with a very high (but finite) maximum size. Use only after careful consideration.This pool may be used for one-off CPU-bound activities, but its maximum size is so high that it doesn't really work well to do a lot of CPU-bound work in parallel here: submitting more CPU-bound tasks than we have CPUs to run them will burn a lot of CPU just context-switching in order to try and make fair progress on all the threads at once. Better to submit fewer tasks and wait for them to complete before submitting more, for instance using
ThrottledTaskRunner
and friends.Likewise you can do IO on this pool, but using it for lots of concurrent IO is likely harmful in clusters with poor concurrent IO performance (especially if using spinning disks).
Blocking on a future on this pool risks deadlock if there's a chance that the completion of the future depends on work being done on this pool. Unfortunately that's pretty likely in most cases because of how often this pool is used; it's really rare to hit such a deadlock because of the high limit on the pool size, but when it happens it is extremely harmful to the node. For more information, see e.g.
UnsafePlainActionFuture
.This pool is for instance used for recovery-related work, which is a mix of CPU-bound and IO-bound work and does not block on futures. The recovery subsystem bounds its own concurrency, and therefore the amount of recovery work done on the
#GENERIC
pool, viacluster.routing.allocation.node_concurrent_recoveries
and related settings. This pool is a good choice for recovery work because the threads used by recovery will be used by other#GENERIC
work too rather than mostly sitting idle until cleaned up. Idle threads are surprisingly costly sometimes.This pool does not reject any task. Tasks you submit to this executor after the pool starts to shut down may simply never run.
- See Also:
-
CLUSTER_COORDINATION
A thread pool solely for the use of the cluster coordination subsystem that relates to cluster state updates, master elections, cluster membership and so on.This pool defaults to a single thread to avoid contention on
Coordinator#mutex
.- See Also:
-
GET
- See Also:
-
ANALYZE
- See Also:
-
WRITE
- See Also:
-
SEARCH
- See Also:
-
SEARCH_COORDINATION
- See Also:
-
AUTO_COMPLETE
- See Also:
-
MANAGEMENT
A thread pool for running tasks related to cluster management, including collecting and exposing stats in APIs and certain other internal tasks.This pool is deliberately small in order to throttle the rate at which such tasks are executed and avoid diverting resources away from production-critical work such as indexing and search. You may run long-running (CPU-bound or IO-bound) tasks on this pool, but if the work relates to a REST API call then it must be cancellable in order to prevent an overexcited client from blocking or delaying other management work.
Note that a cluster with overloaded
MANAGEMENT
pools will typically struggle to respond to stats APIs and may be hard to troubleshoot.- See Also:
-
FLUSH
- See Also:
-
REFRESH
- See Also:
-
WARMER
- See Also:
-
SNAPSHOT
- See Also:
-
SNAPSHOT_META
- See Also:
-
MERGE
- See Also:
-
FORCE_MERGE
- See Also:
-
FETCH_SHARD_STARTED
- See Also:
-
FETCH_SHARD_STORE
- See Also:
-
SYSTEM_READ
- See Also:
-
SYSTEM_WRITE
- See Also:
-
SYSTEM_CRITICAL_READ
- See Also:
-
SYSTEM_CRITICAL_WRITE
- See Also:
-
-
Constructor Details
-
Names
public Names()
-