# Clarify telegraf agent configuration to avoid metric buffer overflow

**URL:** <https://community.influxdata.com/t/clarify-telegraf-agent-configuration-to-avoid-metric-buffer-overflow/22106>\
**Category:** Telegraf\
**Tags:** influxdb, telegraf, time-series, performance\
**Created:** [October 18, 2021, 7:58am UTC](https://community.influxdata.com/t/clarify-telegraf-agent-configuration-to-avoid-metric-buffer-overflow/22106 "2021-10-18T07:58:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pkoeltz](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/pkoeltz/32/9597_2.png) [@pkoeltz](https://community.influxdata.com/u/pkoeltz)\
**Post date:** [October 18, 2021, 7:58am UTC](https://community.influxdata.com/t/clarify-telegraf-agent-configuration-to-avoid-metric-buffer-overflow/22106/1 "2021-10-18T07:58:13Z")

</div>

Hi everyone,

After getting some **metric buffer overflow** warning messages, I am trying to understand better how the fundamental agent parameters `interval`, `metric_batch_size`, `metric_buffer_limit` and `flush_interval` impact each other.

Looking the [specification](https://docs.influxdata.com/telegraf/v1.20/administration/configuration/#agent-configuration), these 3 parameters are defined as:

- **interval** : Default data collection interval for all inputs
- **metric\_batch\_size** : Telegraf will send metrics to output in batch of at most `metric_batch_size` metrics.
- **metric\_buffer\_limit** : Telegraf will cache `metric_buffer_limit` metrics for each output, and will flush this buffer on a successful write. This should be a multiple of `metric_batch_size` and could not be less than 2 times `metric_batch_size` .
- **flush\_interval** : Default data flushing interval for all outputs. You should not set this below `interval` . Maximum `flush_interval` will be `flush_interval` + `flush_jitter`

What I understand is that

- Data is only written to the output at each `flush_interval` .
- If not all the data can be written, it uses the buffer to store.

What I am not sure to understand is when will the buffered data be written to the output again ? Will it be at next `flush_interval` occurence ?

Thanks in advance for your help on this !

---

<div class="post-metadata">

**Author:** ![Jay\_Clifford](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jay_clifford/32/8287_2.png) [@Jay\_Clifford](https://community.influxdata.com/u/Jay_Clifford)\
**Post date:** [October 18, 2021, 9:34am UTC](https://community.influxdata.com/t/clarify-telegraf-agent-configuration-to-avoid-metric-buffer-overflow/22106/2 "2021-10-18T09:34:08Z")

</div>

hi @pkoeltz,  
yes, you are correct. The data will be sent at the next flush interval.

---

<div class="post-metadata">

**Author:** ![pkoeltz](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/pkoeltz/32/9597_2.png) [@pkoeltz](https://community.influxdata.com/u/pkoeltz)\
**Post date:** [October 19, 2021, 1:01am UTC](https://community.influxdata.com/t/clarify-telegraf-agent-configuration-to-avoid-metric-buffer-overflow/22106/3 "2021-10-19T01:01:43Z")

</div>

Thank you for your answer !

---

<div class="post-metadata">

**Author:** ![Jay\_Clifford](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jay_clifford/32/8287_2.png) [@Jay\_Clifford](https://community.influxdata.com/u/Jay_Clifford)\
**Post date:** [October 19, 2021, 9:27am UTC](https://community.influxdata.com/t/clarify-telegraf-agent-configuration-to-avoid-metric-buffer-overflow/22106/4 "2021-10-19T09:27:58Z")

</div>

No worries 🙂 . Any time!
