# Logstash jmx input slow

**URL:** <https://discuss.elastic.co/t/logstash-jmx-input-slow/81531>\
**Category:** Logstash\
**Created:** [April 6, 2017, 8:22pm UTC](https://discuss.elastic.co/t/logstash-jmx-input-slow/81531 "2017-04-06T20:22:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![k1ng87](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/k1ng87/32/88865_2.png) [@k1ng87](https://discuss.elastic.co/u/k1ng87)\
**Post date:** [April 6, 2017, 8:22pm UTC](https://discuss.elastic.co/t/logstash-jmx-input-slow/81531/1 "2017-04-06T20:22:57Z")

</div>

I'm using a the logstash jmx input pluggin to poll a specific mbean every second (return about 4000 messages every second). What I'm seeing right now, is that its not able to poll every second as it seems that there is some bottleneck that I can't quite pinpoint.

My config looks like this:

```
input { 
        jmx {
          path => "/home/ec2-user/jmx-input"
          polling_frequency => 1
          nb_thread => 10
        }

}
output {
        kafka { 
                topic_id => "kafka-jmx"
                bootstrap_servers => "kafka1.com:9092"
                batch_size => 6000
                acks => "0"
                key_serializer =>"org.apache.kafka.common.serialization.StringSerializer"
                codec => "json_lines"
        }
}

```

And I start it like this:

```
./logstash/bin/logstash -f jmx-input.conf -w 12

```

I've tried various batch sizes (150-6000) and nb\_threads up to 16 but still can't get the jmx to flow without having to wait.

How can I figure out where this bottleneck is and what to tune?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [April 7, 2017, 7:49am UTC](https://discuss.elastic.co/t/logstash-jmx-input-slow/81531/2 "2017-04-07T07:49:43Z")

</div>

To find the bottleneck you need to isolate the components and try them one by one. For example, what if you use a drop filter to delete all events? What event rate do you get? What if you use a very cheap input like stdin or file together with your kafka output? What's the rate?

---

<div class="post-metadata">

**Author:** ![k1ng87](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/k1ng87/32/88865_2.png) [@k1ng87](https://discuss.elastic.co/u/k1ng87)\
**Post date:** [April 7, 2017, 3:26pm UTC](https://discuss.elastic.co/t/logstash-jmx-input-slow/81531/3 "2017-04-07T15:26:23Z")

</div>

So I did take out the filter and did an output to stdout...but i still get the `You must adapt nb_thread, retrieve_interval to the number of jvm/metrics you want to retrieve. [2017-04-07T11:23:57,719][INFO][logstash.inputs.jmx] Loading configuration files in path {:path=>"/home/ec2-user/jmx-input"} [2017-04-07T11:23:58,720][WARN][logstash.inputs.jmx] The time taken to retrieve metrics is more important than the retrieve_interval time set.`

issue coming up when logstash starts. I've increased `nb_threads` to 20 and still get that issue...`nb_threads` doesn't seem to help.

I've also increased `pipeline.workers` and `output.workers` to 4 each and still get the same result...

---

<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:** [May 5, 2017, 3:28pm UTC](https://discuss.elastic.co/t/logstash-jmx-input-slow/81531/4 "2017-05-05T15:28:59Z")

</div>

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