# Does file input plugin support backpressure

**URL:** <https://discuss.elastic.co/t/does-file-input-plugin-support-backpressure/378035>\
**Category:** Logstash\
**Created:** [May 12, 2025, 11:35am UTC](https://discuss.elastic.co/t/does-file-input-plugin-support-backpressure/378035 "2025-05-12T11:35:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anandh\_Kumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anandh_kumar/32/82028_2.png) [@Anandh\_Kumar](https://discuss.elastic.co/u/Anandh_Kumar)\
**Post date:** [May 12, 2025, 11:35am UTC](https://discuss.elastic.co/t/does-file-input-plugin-support-backpressure/378035/1 "2025-05-12T11:35:23Z")

</div>

We are using a file input plugin 4.4 latest version with logstash 8.17.0.

We have a kafka output plugin using a file input plugin using a persistent queue on a dedicated pipeline.  
Does file input support backpressure ,ie if kafka output is blocked does it continue updating the sincedb register?

From our lab test it seems if kafka is not reachable ,sincedb does not get updated. Once the output is available it seems to update sincedb file again.

---

<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:** [May 12, 2025, 12:47pm UTC](https://discuss.elastic.co/t/does-file-input-plugin-support-backpressure/378035/2 "2025-05-12T12:47:22Z")

</div>

> [@Anandh\_Kumar](#):
>
> Does file input support backpressure ,ie if kafka output is blocked does it continue updating the sincedb register?

No, this is the oposite of back pressure, if the output is blocked, logstash will fill-up the queue, after the queue is full, it will apply back pressure on the input, in this case it will make the input stop getting new data as it cannot store it anymore on the queue and cannot published the current events.

> [@Anandh\_Kumar](#):
>
> From our lab test it seems if kafka is not reachable ,sincedb does not get updated. Once the output is available it seems to update sincedb file again.

This is how it should work, if Logstash cannot output the events, it should stop reading new events.

---

<div class="post-metadata">

**Author:** ![Anandh\_Kumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anandh_kumar/32/82028_2.png) [@Anandh\_Kumar](https://discuss.elastic.co/u/Anandh_Kumar)\
**Post date:** [May 12, 2025, 1:00pm UTC](https://discuss.elastic.co/t/does-file-input-plugin-support-backpressure/378035/3 "2025-05-12T13:00:55Z")

</div>

THank you for your swift response ! Yes you are correct certain inputs have documented back pressure features for example beats input stops/slows down when the output is blocked.

But is the same applicable for fie input in specific? There are contrasting answers on the net, that file input continues reading even if output is blocked and queue is full and keeps updating the sincedb registry.

There are also some discussions that suggest files stop reading once queue is full.

Official documentation on file input does not specifiy this behaviour explicitly.

---

<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:** [May 12, 2025, 1:13pm UTC](https://discuss.elastic.co/t/does-file-input-plugin-support-backpressure/378035/4 "2025-05-12T13:13:08Z")

</div>

> [@Anandh\_Kumar](#):
>
> There are contrasting answers on the net, that file input continues reading even if output is blocked and queue is full and keeps updating the sincedb registry.

Do you have an example of those answers? Never saw anything like this in years using Logstash.

> [@Anandh\_Kumar](#):
>
> Official documentation on file input does not specifiy this behaviour explicitly.

Unfortunately there is no official documentation that lists how each inputs deals with back pressure.

But the file input only reads new lines after previous lines received an ack that they were processed by the filters and outputs, so if Logstash cannot process the events it is expected that the file input will not read new lines.

This works in the same way when using filebeat.

---

<div class="post-metadata">

**Author:** ![Anandh\_Kumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anandh_kumar/32/82028_2.png) [@Anandh\_Kumar](https://discuss.elastic.co/u/Anandh_Kumar)\
**Post date:** [May 12, 2025, 1:44pm UTC](https://discuss.elastic.co/t/does-file-input-plugin-support-backpressure/378035/5 "2025-05-12T13:44:39Z")

</div>

I probably generalised it too soon based on some chatgpt responses, but below forums talk about how filebeat has clear backpressure and a kind of circuitbreaker mechanism and also log the backpressure onset, whilst certain other inputs do not support backpressure. They do not talk about file input in specific though.

> <https://github.com/elastic/logstash/issues/5317>
>
> Although in most scenarios logstash correctly applies back pressure to the input…s, only in the case of beats input that backpressure is signalled in the logs.
> 
> For sizing/scalling purposes, it'd be very helpful to get warnings from logstash about backpressure.

> [@Where do incoming events go when Logstash is cpu-bound?](https://discuss.elastic.co/t/where-do-incoming-events-go-when-logstash-is-cpu-bound/65197):
>
> Hi, I have a logstash instance which is taking in quite a bit of traffic via the tcp input. Logstash is currently cpu-bound on this particular server, which I understand is not at all an unusual situation. By cpu-bound I mean that I have six CPUs on my server, 6 worker threads, and each worker thread is using 95-100% of CPU time (one worker thread per CPU). Memory utilization and I/O are on the low side. I'd like to better understand what exactly is going on when CPU bound. I assume that, sinc…
