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

Add indexing pressure documentation #59456

Merged
merged 12 commits into from
Jul 21, 2020
Merged
Show file tree
Hide file tree
Changes from 3 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
60 changes: 60 additions & 0 deletions docs/reference/cluster/nodes-stats.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ using metrics.
`http`::
HTTP connection information.

`indexing_pressure`::
Indexing pressure statistics about total and current indexing load and
Tim-Brooks marked this conversation as resolved.
Show resolved Hide resolved
indexing rejections.

`indices`::
Indices stats about size, document count, indexing and deletion times,
search times, field cache size, merges and flushes.
Expand Down Expand Up @@ -2099,6 +2103,62 @@ Number of failed operations for the processor.
=======
======

[[cluster-nodes-stats-api-response-body-indexing-pressure]]
`indexing_pressure`::
(object)
Contains indexing pressure statistics for the node.
Tim-Brooks marked this conversation as resolved.
Show resolved Hide resolved
+
.Properties of `indexing_pressure`
[%collapsible%open]
======
`total`::
(object)
Contains statistics for cumulative indexing load since the node started.
Tim-Brooks marked this conversation as resolved.
Show resolved Hide resolved
+
.Properties of `<total>`
[%collapsible%open]
=======
`coordinating_and_primary_bytes`::
(integer)
Bytes consumed by indexing requests in the coordinating or primary stage.

`replica_bytes`::
(integer)
Bytes consumed by indexing requests in the replica stage.

`all_bytes`::
(integer)
Bytes consumed by indexing requests in the coordinating, primary, or replica stage.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are human readable versions of these stats available?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is not. My understanding is that human readable versions is disabled by default. So I think we can add human readable interpretations in 7.10? @ywelsch I assume it is too late to make this change after feature freeze since it is kind of a feature?


`coordinating_and_primary_memory_limit_rejections`::
(integer)
Rejections of indexing requests in the coordinating or primary stage.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Rejections of indexing requests in the coordinating or primary stage.
Number of indexing requests rejected in the coordinating or primary stage.


`replica_memory_limit_rejections`::
(integer)
Rejections of indexing requests in the replica stage.
Tim-Brooks marked this conversation as resolved.
Show resolved Hide resolved
=======
`current`::
(object)
Contains statistics for current indexing load.
+
.Properties of `<current>`
[%collapsible%open]
=======
`coordinating_and_primary_bytes`::
(integer)
Bytes consumed by indexing requests in the coordinating or primary stage.

`replica_bytes`::
(integer)
Bytes consumed by indexing requests in the replica stage.

`all_bytes`::
(integer)
Bytes consumed by indexing requests in the coordinating, primary, or replica stage.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question re: human readable stats

=======
======

[[cluster-nodes-stats-api-response-body-adaptive-selection]]
`adaptive_selection`::
(object)
Expand Down
56 changes: 56 additions & 0 deletions docs/reference/index-modules/indexing-pressure.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
[[index-modules-indexing-pressure]]
== Indexing Pressure

Indexing documents into Elasticsearch introduces system load in the form of
memory and CPU load. Each indexing operation includes coordinating, primary, and
replica stages. These stages can be performed across multiple nodes in the
cluster. If too much indexing work is introduced into the system, the cluster
can become saturated.
Tim-Brooks marked this conversation as resolved.
Show resolved Hide resolved

Indexing pressure is primarily generated by external operations such as indexing
requests or CCR follow tasks. However, there is some internal indexing pressure
Tim-Brooks marked this conversation as resolved.
Show resolved Hide resolved
during a shard recovery or primary failover.
Tim-Brooks marked this conversation as resolved.
Show resolved Hide resolved

Elasticsearch internally monitors indexing load. When the load exceeds
certain limits, new indexing work will be rejected.

[float]
=== Indexing Stages
Tim-Brooks marked this conversation as resolved.
Show resolved Hide resolved
ywelsch marked this conversation as resolved.
Show resolved Hide resolved

External indexing operations go through three stages. The node receiving the
indexing request is the coordinating node. In the coordinating stage the node
performs any configured ingest pipelines, separates the request into individual
shard requests, and dispatches the requests to the primary shards.

In the primary stage, the primary shard node ensures that it is still the primary
(otherwise it reroutes the request to the new primary), waits on active shards,
indexes the documents into its <<index-modules-translog,Translog>> and Lucene, and
Tim-Brooks marked this conversation as resolved.
Show resolved Hide resolved
dispatches to the replicas.
Tim-Brooks marked this conversation as resolved.
Show resolved Hide resolved

Finally, in the replica stage, every available replica node indexes the documents
into its <<index-modules-translog,Translog>> and Lucene.
Tim-Brooks marked this conversation as resolved.
Show resolved Hide resolved


[float]
=== Memory Limits

Elasticsearch exposes a node setting `indexing_pressure.memory.limit` which
restricts the number of bytes for outstanding indexing requests. Be default,
Tim-Brooks marked this conversation as resolved.
Show resolved Hide resolved
this setting is configured to be 10% of the heap.
Tim-Brooks marked this conversation as resolved.
Show resolved Hide resolved

A node will start rejecting new indexing work at the coordinating or primary
stage when the number of outstanding coordinating, primary and replica indexing
requests is greater than the configured limit.

A node will start rejecting new indexing work at the replica stage when the
number of outstanding replica indexing requests is greater than 1.5x the
configured limit. This design means that as indexing pressure builds on nodes,
they will naturally stop accepting coordinating and primary work in favor of
outstanding replica work.


[float]
=== Monitoring
Tim-Brooks marked this conversation as resolved.
Show resolved Hide resolved

Indexing pressure metrics are exposed by the
<<cluster-nodes-stats-api-response-body-indexing-pressure,Node Stats API>>.
Tim-Brooks marked this conversation as resolved.
Show resolved Hide resolved