elastic / elastic/logstash

Why is Logstash so slow to start?

Open
#5,507 30 comments 5 reactions 0 assignees View on GitHub
discuss
Dominant language
Java
Stars
14.9k
Forks
3.5k
Avg merge
19h 14m
Merged PRs (30d)
63

Description

Here are some profilling I did on master, where a simple pipeline takes 9 seconds to start executing on my macbook:

```
% bin/logstash -e "input { generator { count => 1 } } output { stdout { codec => dots} }"
bash script Thu Jun 16 11:07:41 WEST 2016
started setting up bundler at 2016-06-16 11:07:43 +0100
require bundler took: 0.359
patching bundler took: 0.56
bundler reset took 0.017
bundler setup took 3.763
done setting bundler 2016-06-16 11:07:48 +0100
runner#run 2016-06-16 11:07:50 +0100
agent#execute 2016-06-16 11:07:50 +0100
Pipeline main started
.Pipeline main has been shutdown
```

This means that, of the 9 seconds it takes to execute the pipeline, we spend:

~2 seconds going from BASH to JRuby
~5 seconds executing `LogStash::Bundler.setup!({:without => [:build, :development]})`: https://github.com/elastic/logstash/blob/master/lib/bootstrap/environment.rb#L64
~2 seconds processing cli args, creating the agent, compiling the pipeline and other setup tasks

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.