Skip to content

Commit 44ea102

Browse files
karenzonerobbavey
andauthored
Doc: Add topic and expand info for in-memory queue (elastic#13246)
Co-authored-by: Rob Bavey <[email protected]>
1 parent 50834d0 commit 44ea102

File tree

3 files changed

+67
-1
lines changed

3 files changed

+67
-1
lines changed

docs/index.asciidoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ include::static/filebeat-modules.asciidoc[]
180180
:edit_url: https://github.com/elastic/logstash/edit/{branch}/docs/static/resiliency.asciidoc
181181
include::static/resiliency.asciidoc[]
182182

183+
:edit_url: https://github.com/elastic/logstash/edit/{branch}/docs/static/mem-queue.asciidoc
184+
include::static/mem-queue.asciidoc[]
185+
183186
:edit_url: https://github.com/elastic/logstash/edit/{branch}/docs/static/persistent-queues.asciidoc
184187
include::static/persistent-queues.asciidoc[]
185188

docs/static/mem-queue.asciidoc

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
[[memory-queue]]
2+
=== Memory queue
3+
4+
By default, Logstash uses in-memory bounded queues between pipeline stages (inputs → pipeline workers) to buffer events.
5+
If Logstash experiences a temporary machine failure, the contents of the memory queue will be lost.
6+
Temporary machine failures are scenarios where Logstash or its host machine are terminated abnormally, but are capable of being restarted.
7+
8+
[[mem-queue-benefits]]
9+
==== Benefits of memory queues
10+
11+
The memory queue might be a good choice if you value throughput over data resiliency.
12+
13+
* Easier configuration
14+
* Easier management and administration
15+
* Faster throughput
16+
17+
[[mem-queue-limitations]]
18+
==== Limitations of memory queues
19+
20+
* Can lose data in abnormal termination
21+
* Don't do well handling sudden bursts of data, where extra capacity in needed for {ls} to catch up
22+
23+
TIP: Consider using <<persistent-queues,persistent queues>> to avoid these limitations.
24+
25+
[[sizing-mem-queue]]
26+
==== Memory queue size
27+
28+
Memory queue size is not configured directly.
29+
It is defined by the number of events, the size of which can vary greatly depending on the event payload.
30+
31+
The maximum number of events that can be held in each memory queue is equal to
32+
the value of `pipeline.batch.size` multiplied by the value of
33+
`pipeline.workers`.
34+
This value is called the "inflight count."
35+
36+
NOTE: Each pipeline has its own queue.
37+
38+
See <<tuning-logstash>> for more info on the effects of adjusting `pipeline.batch.size` and `pipeline.workers`.
39+
40+
[[mq-settings]]
41+
===== Settings that affect queue size
42+
43+
These values can be configured in `logstash.yml` and `pipelines.yml`.
44+
45+
pipeline.batch.size::
46+
Number events to retrieve from inputs before sending to filters+workers
47+
The default is 125.
48+
49+
pipelines.workers::
50+
Number of workers that will, in parallel, execute the filters+outputs stage of the pipeline.
51+
This value defaults to the number of the host's CPU cores.
52+
53+
[[backpressure-mem-queue]]
54+
==== Back pressure
55+
56+
When the queue is full, Logstash puts back pressure on the inputs to stall data
57+
flowing into Logstash.
58+
This mechanism helps Logstash control the rate of data flow at the input stage
59+
without overwhelming outputs like Elasticsearch.
60+
61+
Each input handles back pressure independently.

docs/static/resiliency.asciidoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
[[resiliency]]
2-
== Data resiliency
2+
== Queues and data resiliency
3+
4+
By default, Logstash uses <<memory-queue,in-memory bounded queues>> between pipeline stages (inputs → pipeline workers) to buffer events.
35

46
As data flows through the event processing pipeline, Logstash may encounter
57
situations that prevent it from delivering events to the configured

0 commit comments

Comments
 (0)