hi team, Im getting this log in fluentbit which is...
# fluent-bit
s
hi team, Im getting this log in fluentbit which is deployed in production, can anyone help me in understanding why this happens and what is the recommended config if we get these logs
Copy code
[2025/10/23 09:39:52] [ warn] [input:tail:tail.0] purged rotated file while data ingestion is paused, consider increasing rotate_wait
[2025/10/23 09:41:31] [ info] [input] tail.0 resume (mem buf overlimit)
[2025/10/23 09:41:31] [ warn] [input] tail.0 paused (mem buf overlimit)
[2025/10/23 09:41:31] [ info] [input] pausing tail.0
[2025/10/23 09:41:31] [ info] [input] resume tail.0
[2025/10/23 09:41:31] [ info] [input] tail.0 resume (mem buf overlimit)
currentconfig:
Copy code
[SERVICE]
    Flush        30
    Grace        5
    Daemon       Off
    Log_Level    info
    Parsers_File /fluent-bit/etc/parsers.conf
    Parsers_File /fluent-bit/etc-operator/custom-parsers.conf
    Coro_Stack_Size    24576
    HTTP_Server  On
    Listen 0.0.0.0
    HTTP_Port    2020
    storage.path  /buffers
[INPUT]
    Name         tail
    Buffer_Chunk_Size  100MB
    Buffer_Max_Size  800MB
    DB  /tail-db/tail-containers-state.db
    DB.locking  true
    Ignore_Older  1h
    Mem_Buf_Limit  1000MB
    Parser  cri-log-key
    Path  /var/log/containers/*.log
    Refresh_Interval  5
    Skip_Long_Lines  On
    Tag  kubernetes.*
    storage.pause_on_chunks_overlimit  on
p
Backpressure - your output is not keeping up with the input
s
hey @Pat thanks for the reply, what is the recommended config and what needs to be changed
p
If your output is not keeping up then you have a level of buffering (e.g. for spikes but not for just being too slow all the time) but if that is exceeded then you need to choose: 1. Stop ingesting data (which is what you see here) 2. Throw away data
You need to figure out why backpressure is occurring
Is it a transient issue so you just need more buffering to cope with the spike?
s
wont it go OOM killed if we increase buffer
p
Otherwise you need more resources either to run FB to send to the output or your backend that is receiving the data needs more resources to cope with more output
s
but is there any way other thn increasing e resources either to run FB, like making storage as filesystem
p
I've no idea what you have configured in your infra, if you need more memory then you need more memory so higher limits. That is only if it is a transient spike though: you need to figure that out - is it just unable to cope with the data rates required or is there a spike you need to cope with?
Before asking more questions you need to figure out mine: is it a transient spike or is it unable to cope?
s
when there is a spike we start seeing this issue
p
So it just needs more buffering to cope with the spike? You can test that by temporarily increasing things to confirm.
s
sure, also what if spike is transient spike just curious
p
Filesystem buffering is possible but that ultimately can fill up too so that's why I want you to confirm if it is transient or not. Otherwise you will just fill up the filesystem then see the same thing
Filesystem buffering is certainly recommended for prod usually
The backpressure docs explain it all so I would have a look: https://docs.fluentbit.io/manual/administration/backpressure
s
what if it just unable to cope with the data rates; for this usecase Filesystem buffering will be helpful ?
p
No, you just have more buffering but ultimately that will fill up too. Hence my question to you about confirming is it a spike or just constant underperformance.
Which is it? A spike or not?
s
will check 1 min
nope there is no much spike at present, but still getting the same logs
p
sounds like your output cannot cope for whatever reason - you can check why by looking at your infra and FB
Does FB have enough resources to service the output or is it reporting some kind of back off or other failures from the output which then means it has to slow down?
s
its running there no crashloop as of now, I mean instead of increasing resource I was thinking of optimizinf cinfigs of fluentbit for a long term fix
p
That's not what I asked, what do the metrics/logs say?
Are there any errors/retries reported for output?
What's the CPU usage of FB?
Some outputs support
workers
option to configure multiple threads if it is CPU bound currently
s
image.png
Copy code
resources:
      limits:
        memory: 2000Mi
      requests:
        cpu: 352m
        memory: 1000Mi
p
Nice pics, what does it show?
😅 1
s
kubectl top pod k8s-prod-logging-zone-1b-fluentbit-wlspb -n logs NAME CPU(cores) MEMORY(bytes) k8s-prod-logging-zone-1b-fluentbit-wlspb 2m 7Mi
p
again, are you getting errors/retries and is your CPU saturated?
I would try
workers
if no errors/retries and then potentially increase CPU too, if there are errors/retries then you need to debug why (it'll likely be down to your backend)
s
there is a difference in input and output and output retried metric has increased, No cpu is not saturated current usage is 2m out of cpu: 352m
p
so you can check why it is being retried and see if it's an issue with the backend you are sending too
I would try workers as well then if you have CPU free too
depends on the output though, some don't support workers
s
workers for output ? we are using elasticsearch, fluentbit forwards to elasticsearch
p
check the docs to see how to use it, there's probably a default number of workers configured but not sure what that is
you can do
threaded
input too but if you have filters they'll be single-threaded anyway so normally output workers is what you want
s
ok thanks for the info, so moving to filesystem wont solve this as it can make that full too
p
sure, it's just another buffer
however read the docs on backpressure and buffering to understand properly rather than rely on a random internet stranger