# How to reduce collection time

**URL:** <https://discuss.elastic.co/t/how-to-reduce-collection-time/239730>\
**Category:** Elasticsearch\
**Created:** [July 3, 2020, 4:54am UTC](https://discuss.elastic.co/t/how-to-reduce-collection-time/239730 "2020-07-03T04:54:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jang](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@jang](https://discuss.elastic.co/u/jang)\
**Post date:** [July 3, 2020, 4:54am UTC](https://discuss.elastic.co/t/how-to-reduce-collection-time/239730/1 "2020-07-03T04:54:56Z")

</div>

hello,

I'm using elk.

After a day of testing, there was a problem.

The difference between collection time and log generation time is widening.

For example,  
the collection time and log generation time were exactly the same at first.  
after a day...  
There is a difference of 9 seconds between the collection time and the log time.

please introduce some typical ways to narrow the gap.

---

<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 3, 2020, 5:10am UTC](https://discuss.elastic.co/t/how-to-reduce-collection-time/239730/2 "2020-07-03T05:10:39Z")

</div>

How are you collecting the logs? What is the specification of your Elasticsearch cluster? How much data are you collecting per day?

---

<div class="post-metadata">

**Author:** ![jang](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@jang](https://discuss.elastic.co/u/jang)\
**Post date:** [July 3, 2020, 5:16am UTC](https://discuss.elastic.co/t/how-to-reduce-collection-time/239730/3 "2020-07-03T05:16:08Z")

</div>

i'm using filebeat -\> logstash -\> Amazon ES

elastic cluster node is five.(logstash is only one.)

There are about 30,000 logs a day.

---

<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 3, 2020, 6:32am UTC](https://discuss.elastic.co/t/how-to-reduce-collection-time/239730/4 "2020-07-03T06:32:48Z")

</div>

If Elasticsearch is not able to keep up indexing documents back pressure will be applied. Logstash and Filebeat will eventually adjust and only read logs as fast as Elasticsearch can consume them. The first point to check is therefore whether Elasticsearch is the bottleneck or not. Look for disk I/O, high CPU or signs of long GC or merge throttling in the Elasticsearch logs. You may also be able to get this through the cluster stats API.

If Elasticsearch does not appear to be the bottleneck move up in the chain from there.

What instance types are you using? What type and size of storage do you have?

How much data does these logs result in per day? How many indices and shards are these indexed into?

---

<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:** [July 31, 2020, 6:32am UTC](https://discuss.elastic.co/t/how-to-reduce-collection-time/239730/5 "2020-07-31T06:32:51Z")

</div>

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