You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The process_explorer input plugin only adds data to its own internal state (like flb_pe.memory_bytes), but never removes data from dead processes. If running for a long time, this leads to high memory usage, because old process data is never pruned, and high CPU usage, because cmetric’s metric_hash_lookup function is not actually a hash lookup, but linear search. With a growing number of stale process entries for each metric the fluent-bit process will end up spending most of its time doing this search.
To Reproduce
Run fluent-bit -p scrape_interval=1 -i process_exporter_metrics -o stdout
Run while true; do for i in $(seq 100); do sleep 5 & done; sleep 5; done at the same time to create alot of short-lived processes.
Wait about 10–15 minutes.
Observe increasing CPU and memory usage of the fluent-bit process via htop or similar. Run ptrace record -p <pid> to capture profiling data for a few seconds, run ptrace report and note that the function metric_hash_lookup is on the top of the list.
Expected behavior
CPU and memory usage stays the same.
Your Environment
Version used: 3.1.4 and latest master (commit 104aceb)
Configuration: (none)
Environment name and version (e.g. Kubernetes? What version?): (none)
Server type and version: (none)
Operating System and version: Debian 12
Filters and plugins: plugin_exporter_metrics and stdout
Additional context
fluent-bit’s process_exporter plugin is basically unusable on low-end embedded devices. Also note that during testing fluent-bit might crash due to a different bug (see #9548).
The text was updated successfully, but these errors were encountered:
Bug Report
Describe the bug
The process_explorer input plugin only adds data to its own internal state (like
flb_pe.memory_bytes
), but never removes data from dead processes. If running for a long time, this leads to high memory usage, because old process data is never pruned, and high CPU usage, because cmetric’smetric_hash_lookup
function is not actually a hash lookup, but linear search. With a growing number of stale process entries for each metric the fluent-bit process will end up spending most of its time doing this search.To Reproduce
fluent-bit -p scrape_interval=1 -i process_exporter_metrics -o stdout
while true; do for i in $(seq 100); do sleep 5 & done; sleep 5; done
at the same time to create alot of short-lived processes.htop
or similar. Runptrace record -p <pid>
to capture profiling data for a few seconds, runptrace report
and note that the function metric_hash_lookup is on the top of the list.Expected behavior
CPU and memory usage stays the same.
Your Environment
Additional context
fluent-bit’s process_exporter plugin is basically unusable on low-end embedded devices. Also note that during testing fluent-bit might crash due to a different bug (see #9548).
The text was updated successfully, but these errors were encountered: