Skip to content

Commit fb9458a

Browse files
Add multithreading doc (#1439)
* summary: Add multithreading doc to sidebar Signed-off-by: Alexa Kreizinger <[email protected]> * administration: multithreading: Write multithreading doc Signed-off-by: Alexa Kreizinger <[email protected]> * Update administration/multithreading.md Signed-off-by: Alexa Kreizinger <[email protected]> * administration: multithreading: fix typo Signed-off-by: José Lecaros <[email protected]> --------- Signed-off-by: Alexa Kreizinger <[email protected]> Signed-off-by: José Lecaros <[email protected]> Co-authored-by: José Lecaros <[email protected]>
1 parent a69c4a8 commit fb9458a

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
* [Networking](administration/networking.md)
6868
* [Memory Management](administration/memory-management.md)
6969
* [Monitoring](administration/monitoring.md)
70+
* [Multithreading](administration/multithreading.md)
7071
* [HTTP Proxy](administration/http-proxy.md)
7172
* [Hot Reload](administration/hot-reload.md)
7273
* [Troubleshooting](administration/troubleshooting.md)

administration/multithreading.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
description: Learn how to run Fluent Bit in multiple threads for improved scalability.
3+
---
4+
5+
# Multithreading
6+
7+
Fluent Bit has one event loop to handle critical operations, like managing
8+
timers, receiving internal messages, scheduling flushes, and handling retries.
9+
This event loop runs in Fluent Bit's main thread.
10+
11+
To free up resources in the main thread, you can configure
12+
[inputs](../pipeline/inputs/README.md) and [outputs](../pipeline/outputs/README.md)
13+
to run in their own self-contained threads. However, inputs and outputs implement
14+
multithreading in distinct ways: inputs can run in **threaded** mode, and outputs
15+
can use one or more **workers**.
16+
17+
Threading also affects certain processes related to inputs and outputs. For example,
18+
[filters](../pipeline/filters/README.md) always run in the main thread, but
19+
[processors](../pipeline/processors/README.md) run in the self-contained threads of
20+
their respective inputs or outputs, if applicable.
21+
22+
## Inputs
23+
24+
When inputs collect telemetry data, they can either perform this process
25+
inside Fluent Bit's main thread or inside a separate dedicated thread. You can
26+
configure this behavior by enabling or disabling the `threaded` setting.
27+
28+
All inputs are capable of running in threaded mode, but certain inputs always
29+
run in threaded mode regardless of configuration. These always-threaded inputs are:
30+
31+
- [Kubernetes Events](../pipeline/inputs/kubernetes-events.md)
32+
- [Node Exporter Metrics](../pipeline/inputs/node-exporter-metrics.md)
33+
- [Process Exporter Metrics](../pipeline/inputs/process-exporter-metrics.md)
34+
- [Windows Exporter Metrics](../pipeline/inputs/windows-exporter-metrics.md)
35+
36+
Inputs are not internally aware of multithreading. If an input runs in threaded
37+
mode, Fluent Bit manages the logistics of that input's thread.
38+
39+
## Outputs
40+
41+
When outputs flush data, they can either perform this operation inside Fluent Bit's
42+
main thread or inside a separate dedicated thread called a _worker_. Each output
43+
can have one or more workers running in parallel, and each worker can handle multiple
44+
concurrent flushes. You can configure this behavior by changing the value of the
45+
`workers` setting.
46+
47+
All outputs are capable of running in multiple workers, and each output has
48+
a default value of `0`, `1`, or `2` workers. However, even if an output uses
49+
workers by default, you can safely reduce the number of workers below the default
50+
or disable workers entirely.

0 commit comments

Comments
 (0)