- Elasticsearch Guide: other versions:
- Getting Started
- Setup
- Breaking changes
- Breaking changes in 2.0
- Removed features
- Network changes
- Multiple
path.data
striping - Mapping changes
- CRUD and routing changes
- Query DSL changes
- Search changes
- Aggregation changes
- Parent/Child changes
- Scripting changes
- Index API changes
- Snapshot and Restore changes
- Plugin and packaging changes
- Setting changes
- Stats, info, and
cat
changes - Java API changes
- Breaking changes in 2.0
- API Conventions
- Document APIs
- Search APIs
- Aggregations
- Metrics Aggregations
- Bucket Aggregations
- Children Aggregation
- Date Histogram Aggregation
- Date Range Aggregation
- Filter Aggregation
- Filters Aggregation
- Geo Distance Aggregation
- GeoHash grid Aggregation
- Global Aggregation
- Histogram Aggregation
- IPv4 Range Aggregation
- Missing Aggregation
- Nested Aggregation
- Range Aggregation
- Reverse nested Aggregation
- Sampler Aggregation
- Significant Terms Aggregation
- Terms Aggregation
- Pipeline Aggregations
- Caching heavy aggregations
- Returning only aggregation results
- Aggregation Metadata
- Indices APIs
- Create Index
- Delete Index
- Get Index
- Indices Exists
- Open / Close Index API
- Put Mapping
- Get Mapping
- Get Field Mapping
- Types Exists
- Index Aliases
- Update Indices Settings
- Get Settings
- Analyze
- Index Templates
- Warmers
- Shadow replica indices
- Indices Stats
- Indices Segments
- Indices Recovery
- Indices Shard Stores
- Clear Cache
- Flush
- Refresh
- Optimize
- Upgrade
- cat APIs
- Cluster APIs
- Query DSL
- Mapping
- Field datatypes
- Meta-Fields
- Mapping parameters
analyzer
boost
coerce
copy_to
doc_values
dynamic
enabled
fielddata
format
geohash
geohash_precision
geohash_prefix
ignore_above
ignore_malformed
include_in_all
index
index_options
lat_lon
fields
norms
null_value
position_increment_gap
precision_step
properties
search_analyzer
similarity
store
term_vector
- Dynamic Mapping
- Transform
- Analysis
- Analyzers
- Tokenizers
- Token Filters
- Standard Token Filter
- ASCII Folding Token Filter
- Length Token Filter
- Lowercase Token Filter
- Uppercase Token Filter
- NGram Token Filter
- Edge NGram Token Filter
- Porter Stem Token Filter
- Shingle Token Filter
- Stop Token Filter
- Word Delimiter Token Filter
- Stemmer Token Filter
- Stemmer Override Token Filter
- Keyword Marker Token Filter
- Keyword Repeat Token Filter
- KStem Token Filter
- Snowball Token Filter
- Phonetic Token Filter
- Synonym Token Filter
- Compound Word Token Filter
- Reverse Token Filter
- Elision Token Filter
- Truncate Token Filter
- Unique Token Filter
- Pattern Capture Token Filter
- Pattern Replace Token Filter
- Trim Token Filter
- Limit Token Count Token Filter
- Hunspell Token Filter
- Common Grams Token Filter
- Normalization Token Filter
- CJK Width Token Filter
- CJK Bigram Token Filter
- Delimited Payload Token Filter
- Keep Words Token Filter
- Keep Types Token Filter
- Classic Token Filter
- Apostrophe Token Filter
- Character Filters
- ICU Analysis Plugin
- Modules
- Index Modules
- Testing
- Glossary of terms
- Release Notes
WARNING: Version 2.0 of Elasticsearch has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
Thread Pool
editThread Pool
editA node holds several thread pools in order to improve how threads memory consumption are managed within a node. Many of these pools also have queues associated with them, which allow pending requests to be held instead of discarded.
There are several thread pools, but the important ones include:
-
index
-
For index/delete operations. Defaults to
fixed
with a size of# of available processors
, queue_size of200
. -
search
-
For count/search operations. Defaults to
fixed
with a size ofint((# of available_processors * 3) / 2) + 1
, queue_size of1000
. -
suggest
-
For suggest operations. Defaults to
fixed
with a size of# of available processors
, queue_size of1000
. -
get
-
For get operations. Defaults to
fixed
with a size of# of available processors
, queue_size of1000
. -
bulk
-
For bulk operations. Defaults to
fixed
with a size of# of available processors
, queue_size of50
. -
percolate
-
For percolate operations. Defaults to
fixed
with a size of# of available processors
, queue_size of1000
. -
snapshot
-
For snapshot/restore operations. Defaults to
scaling
with a keep-alive of5m
and a size ofmin(5, (# of available processors)/2)
. -
warmer
-
For segment warm-up operations. Defaults to
scaling
with a keep-alive of5m
and a size ofmin(5, (# of available processors)/2)
. -
refresh
-
For refresh operations. Defaults to
scaling
with a keep-alive of5m
and a size ofmin(10, (# of available processors)/2)
. -
listener
-
Mainly for java client executing of action when listener threaded is set to true.
Default size of
(# of available processors)/2
, max at 10.
Changing a specific thread pool can be done by setting its type and
specific type parameters, for example, changing the index
thread pool
to have more threads:
threadpool: index: type: fixed size: 30
you can update threadpool settings live using Cluster Update Settings.
Thread pool types
editThe following are the types of thread pools that can be used and their respective parameters:
cache
editThe cache
thread pool is an unbounded thread pool that will spawn a
thread if there are pending requests. Here is an example of how to set
it:
threadpool: index: type: cached
fixed
editThe fixed
thread pool holds a fixed size of threads to handle the
requests with a queue (optionally bounded) for pending requests that
have no threads to service them.
The size
parameter controls the number of threads, and defaults to the
number of cores times 5.
The queue_size
allows to control the size of the queue of pending
requests that have no threads to execute them. By default, it is set to
-1
which means its unbounded. When a request comes in and the queue is
full, it will abort the request.
threadpool: index: type: fixed size: 30 queue_size: 1000
scaling
editThe scaling
thread pool holds a dynamic number of threads. This number is
proportional to the workload and varies between 1 and the value of the
size
parameter.
The keep_alive
parameter determines how long a thread should be kept
around in the thread pool without it doing any work.
threadpool: warmer: type: scaling size: 8 keep_alive: 2m
Processors setting
editThe number of processors is automatically detected, and the thread pool
settings are automatically set based on it. Sometimes, the number of processors
are wrongly detected, in such cases, the number of processors can be
explicitly set using the processors
setting.
In order to check the number of processors detected, use the nodes info
API with the os
flag.