# Increse performance of Logstash with multiple input

**URL:** https://discuss.elastic.co/t/increse-performance-of-logstash-with-multiple-input/93910
**Category:** Logstash
**Created:** [July 20, 2017, 10:25am UTC](https://discuss.elastic.co/t/increse-performance-of-logstash-with-multiple-input/93910 "2017-07-20T10:25:22Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Zeeshan\_Alam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zeeshan_alam/32/94298_2.png) [@Zeeshan\_Alam](https://discuss.elastic.co/u/Zeeshan_Alam)
#### Post date: [July 20, 2017, 10:25am UTC](https://discuss.elastic.co/t/increse-performance-of-logstash-with-multiple-input/93910/1 "2017-07-20T10:25:22Z")

</div>

I am using Logstash to read from Kafka. My VM is having 6 processors.

I looked at following two config:

**pipeline.workers:** Default is Number of the host’s CPU cores

> The number of workers that will, in parallel, execute the filter and output stages of the pipeline. If you find that events are backing up, or that the CPU is not saturated, consider increasing this number to better utilize machine processing power

**pipeline.output.workers:** Default is 1

> The number of workers to use per output plugin instance.

Since each kafka input will be processed in a single thread, to increase parallelism should I split it into multiple kafka inputs and change **pipeline.output.workers: 6**

Is this a good approach to maximize the usage of my VM?

```
input {
  kafka {
            bootstrap_servers=>"kfk1:9092,kfk2:9092"
            topics => ["MyTopic"]
            group_id => "kafka-test101"
  }
  kafka {
            bootstrap_servers=>"kfk1:9092,kfk2:9092"
            topics => ["MyTopic"]
             group_id => "kafka-test101"
  }
  kafka {
            bootstrap_servers=>"kfk1:9092,kfk2:9092"
            topics => ["MyTopic"]
             group_id => "kafka-test101"
  }
  kafka {
            bootstrap_servers=>"kfk1:9092,kfk2:9092"
            topics => ["MyTopic"]
            group_id => "kafka-test101"
  }
  kafka {
            bootstrap_servers=>"kfk1:9092,kfk2:9092"
            topics => ["MyTopic"]
             group_id => "kafka-test101"
  }
  kafka {
            bootstrap_servers=>"kfk1:9092,kfk2:9092"
            topics => ["MyTopic"]
             group_id => "kafka-test101"
  }
}
output{
	elasticsearch {
			hosts => ["host1,host2,host3"]
			index => "logstash-myindex-%{+YYYY.MM.dd}-1"
		}
}

```

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [July 20, 2017, 12:00pm UTC](https://discuss.elastic.co/t/increse-performance-of-logstash-with-multiple-input/93910/2 "2017-07-20T12:00:57Z")

</div>

How did you establish that the Kafka input is the limiting factor in your pipeline? Have you looked at tweaking the config of the input plugin, e.g. through the number of [consumer threads](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-kafka.html#plugins-inputs-kafka-consumer_threads)?

---

<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: [August 17, 2017, 12:01pm UTC](https://discuss.elastic.co/t/increse-performance-of-logstash-with-multiple-input/93910/3 "2017-08-17T12:01:08Z")

</div>

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