# Let Logstash handle multi-pipeline performance?

**URL:** https://discuss.elastic.co/t/let-logstash-handle-multi-pipeline-performance/265177
**Category:** Logstash
**Created:** [February 23, 2021, 8:22am UTC](https://discuss.elastic.co/t/let-logstash-handle-multi-pipeline-performance/265177 "2021-02-23T08:22:47Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![nico127](https://avatars.discourse-cdn.com/v4/letter/n/9de053/32.png) [@nico127](https://discuss.elastic.co/u/nico127)
#### Post date: [February 23, 2021, 8:22am UTC](https://discuss.elastic.co/t/let-logstash-handle-multi-pipeline-performance/265177/1 "2021-02-23T08:22:47Z")

</div>

In the case of multi-pipeline, I understand that the canonical way to handle performance is to manually configure each pipeline, e.g. to use N pipeline workers, or to have a batch size of M.

is it possible to let Logstash handle this? For example, configure the size of a "pool" of workers and let Logstash (or the JVM really) assign them to each pipeline as needed?

If not, is there any recommendations about how to handle this, considering it isn't trivial to predict exactly which pipelines need the most resources, when, etc?

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [February 23, 2021, 3:46pm UTC](https://discuss.elastic.co/t/let-logstash-handle-multi-pipeline-performance/265177/2 "2021-02-23T15:46:55Z")

</div>

if you do not set the value of the `pipeline.workers` logstash will use one worker per cpu core.

What I do in such cases is to configure the number of workers according to the number of events per second of each pipeline.

PIpelines with a high e/s rate will use one worker per cpu core, pipelines with small e/s rate will have less workers.

For example, there is no reason to let a pipeline with 50 e/s running with 8 workers on a 8 CPU machine, but it makes sense for a pipeline with 5000 e/s. It all depends on

But this is just what I do in my use case, you would need to test with your pipelines, let it run without changing the config for a couple of days and start changing it to see what works best.

---

<div class="post-metadata">

### Author: ![nico127](https://avatars.discourse-cdn.com/v4/letter/n/9de053/32.png) [@nico127](https://discuss.elastic.co/u/nico127)
#### Post date: [February 24, 2021, 8:25am UTC](https://discuss.elastic.co/t/let-logstash-handle-multi-pipeline-performance/265177/3 "2021-02-24T08:25:26Z")

</div>

> [@leandrojmp](#):
>
> if you do not set the value of the `pipeline.workers` logstash will use one worker per cpu core.

Yeah, but that's not great as you say after.

> [@leandrojmp](#):
>
> PIpelines with a high e/s rate will use one worker per cpu core, pipelines with small e/s rate will have less workers.
> 
> For example, there is no reason to let a pipeline with 50 e/s running with 8 workers on a 8 CPU machine, but it makes sense for a pipeline with 5000 e/s. It all depends on

Thing is, this might not be constant. One pipeline might have 2000 e/s for 5 minutes every 2 hours and 17 e/s the other 1h55, for an average of 100e/s; while another one might have a constant 200e/s (just making up random numbers here). This might also not be so predictable, there might be bursts of incoming events for whatever reason. Hence, a static, manual configuration of the number of workers seems pretty difficult to optimize for multi-pipelines situations.

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [February 24, 2021, 3:08pm UTC](https://discuss.elastic.co/t/let-logstash-handle-multi-pipeline-performance/265177/4 "2021-02-24T15:08:00Z")

</div>

There is not much you can do related to the `pipeline.workers,` you have the option to set it to a fixed number or do not set and use one worker per CPU.

Are you having any performance issue in your logstash node? If not, I see no reason to change the number of workers.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [March 24, 2021, 3:08pm UTC](https://discuss.elastic.co/t/let-logstash-handle-multi-pipeline-performance/265177/5 "2021-03-24T15:08:36Z")

</div>

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