Fluentd loki plugin: What is the recommended value for flush_thread_count?

Hi everyone,

I am trying to find the optimal configuration for the fluentd loki plugin. I was not able to find anything in the documentation Fluentd | Grafana Loki documentation concerning the buffer configuration and especially the flush_thread_count which defines the number of threads that define the number of threads fluentd uses for flushing the data from the buffer and sending it to the output (loki). Any input is welcome.

We haven’t done any sort of extensive performance testing, so I’d take this with a grain of salt.

We are currently using flush_thread_count 2, which seems to work well enough. By default the loki fluentd plugin adds a thread ID to the label to distinguish log streams sent from different threads, so just from this one should try to not set the thread count too high, otherwise you are likely to see a lot of log streams created, which would spread out the in-memory chunks, which means if you don’t have enough log volume this is likely going to be a performance hit, or at minimum leads to more small files being written to your storage (which at minimum could reduce performance when reading).

Thanks a lot for the input, I am willing to experiment with this, and also hopefully do some benchmarking as well