Logstash cpu usage blocked at 50%

Hi everybody !

I have a logstash pipeline which can receive about 10k e/s in event peaks

My logstash usual CPU usage is in "nice" priority with an average 30-40% CPU consumption and without data delay in the data store (LS_NICE=19)

But in event peaks CPU increases until 50%, get stuck at 50% and I notice a data delay.

Adding more logstash servers for my pipeline reduces the data delay without reducing the CPU usage for those which were already processing the pipeline.

My logstash version is logstash 7.2.0

The /etc/logstash/logstash.yml configuration file is almost the default file :

# ------------ Pipeline Settings --------------
#
# The ID of the pipeline.
#
# pipeline.id: main
#
# Set the number of workers that will, in parallel, execute the filters+outputs
# stage of the pipeline.
#
# This defaults to the number of the host's CPU cores.
#
# pipeline.workers: 2
#
# How many events to retrieve from inputs before sending to filters+workers
#
# pipeline.batch.size: 125
#
# How long to wait in milliseconds while polling for the next event
# before dispatching an undersized batch to filters+outputs
#
# pipeline.batch.delay: 50
#
# Force Logstash to exit during shutdown even if there are still inflight
# events in memory. By default, logstash will refuse to quit until all
# received events have been pushed to the outputs.
#
# WARNING: enabling this can lead to data loss during shutdown
#
# pipeline.unsafe_shutdown: false
#
# ------------ Pipeline Configuration Settings --------------
#
# Where to fetch the pipeline configuration for the main pipeline
#
#path.config: /etc/logstash/conf.d
#
# Pipeline configuration string for the main pipeline
#
# config.string:
#
# At startup, test if the configuration is valid and exit (dry run)
#
# config.test_and_exit: false
#
# Periodically check if the configuration has changed and reload the pipeline
# This can also be triggered manually through the SIGHUP signal
#
config.reload.automatic: true
#
# How often to check if the pipeline configuration has changed (in seconds)
#
# config.reload.interval: 3s
#
# Show fully compiled configuration as debug log message
# NOTE: --log.level must be 'debug'
#
# config.debug: false
#
# When enabled, process escaped characters such as \n and \" in strings in the
# pipeline configuration files.
#
# config.support_escapes: false

In /etc/logstash/jvm.options the Xm is 8g (the server has 32GB)

## JVM configuration

# Xms represents the initial size of total heap space
# Xmx represents the maximum size of total heap space

-Xms8g
-Xmx8g

Upgrade this parameter doesn't change anything

How can I upgrade CPU consumption to ingest event peaks ?

Thanks :slight_smile:

Anyone ?

How many pipelines do you have? What is your pipeline configuration?

You can try to increase the number of pipeline.workers, but depending on your pipeline the cause of your delay could not be just the CPU.

You need to share information about your pipeline.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.