-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Doc: Add topic and expand info for in-memory queue #13246
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2af381a
Doc: Add topic and expand info for mem queue
karenzone a716de3
Start fleshing out content and areas to explore
karenzone c80a909
Add mem queue to resiliency topic
karenzone 7193ecf
Changes from code review
karenzone e575a5c
More changes from code review
karenzone 56c79cd
Update docs/static/mem-queue.asciidoc
karenzone File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
[[memory-queue]] | ||
=== Memory queue | ||
|
||
By default, Logstash uses in-memory bounded queues between pipeline stages (inputs → pipeline workers) to buffer events. | ||
If Logstash experiences a temporary machine failure, the contents of the memory queue will be lost. | ||
Temporary machine failures are scenarios where Logstash or its host machine are terminated abnormally, but are capable of being restarted. | ||
|
||
[[mem-queue-benefits]] | ||
==== Benefits of memory queues | ||
|
||
The memory queue might be a good choice if you value throughput over data resiliency. | ||
|
||
* Easier configuration | ||
* Easier management and administration | ||
* Faster throughput | ||
|
||
[[mem-queue-limitations]] | ||
==== Limitations of memory queues | ||
|
||
* Can lose data in abnormal termination | ||
* Don't do well handling sudden bursts of data, where extra capacity in needed for {ls} to catch up | ||
|
||
TIP: Consider using <<persistent-queues,persistent queues>> to avoid these limitations. | ||
|
||
[[sizing-mem-queue]] | ||
==== Memory queue size | ||
|
||
Memory queue size is not configured directly. | ||
It is defined by the number of events, the size of which can vary greatly depending on the event payload. | ||
|
||
The maximum number of events that can be held in each memory queue is equal to | ||
the value of `pipeline.batch.size` multiplied by the value of | ||
`pipeline.workers`. | ||
This value is called the "inflight count." | ||
|
||
NOTE: Each pipeline has its own queue. | ||
|
||
See <<tuning-logstash>> for more info on the effects of adjusting `pipeline.batch.size` and `pipeline.workers`. | ||
|
||
[[mq-settings]] | ||
===== Settings that affect queue size | ||
|
||
These values can be configured in `logstash.yml` and `pipelines.yml`. | ||
|
||
pipeline.batch.size:: | ||
Number events to retrieve from inputs before sending to filters+workers | ||
The default is 125. | ||
|
||
pipelines.workers:: | ||
Number of workers that will, in parallel, execute the filters+outputs stage of the pipeline. | ||
This value defaults to the number of the host's CPU cores. | ||
|
||
[[backpressure-mem-queue]] | ||
==== Back pressure | ||
|
||
When the queue is full, Logstash puts back pressure on the inputs to stall data | ||
flowing into Logstash. | ||
This mechanism helps Logstash control the rate of data flow at the input stage | ||
without overwhelming outputs like Elasticsearch. | ||
|
||
Each input handles back pressure independently. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.