# 缓冲

当 [Fluent Bit](https://fluentbit.io) 处理数据时，它使用系统内存(堆)作为主要和临时的位置来存储被交付前的日志记录，在此私有内存域中处理日志记录。

缓冲是指将记录存储在某处的能力，并且在处理和交付记录时，仍然能够存储更多记录。内存中的缓冲是最快的机制，但是在某些情况下，该机制需要特殊的策略来处理在受约束环境中的数据[积压](/fluentbit/administration/backpressure.md)，数据安全或减少服务内存消耗等问题。

{% hint style="info" %}
第三方服务的网络故障或延迟非常普遍，在某些情况下，当我们无法像接收待处理数据一样快地交付数据时，我们可能会面临积压问题。

我们的缓冲策略旨在解决积压和常规交付故障相关的问题。
{% endhint %}

Fluent Bit 基于缓冲策略，在**内存**中提供了主要的缓冲机制，并使用**文件系统**提供了可选的辅助机制。使用此混合解决方案，您可以安全地应用于任何场景，并在处理数据时保持高性能。

两种机制都不是互斥的，并且当准备好要处理或交付数据时，它们始终位于**内存**中，而队列中的其他数据可能位于文件系统中，直到准备好被处理并移至内存中为止。

要了解有关 Fluent Bit 中缓冲配置的更多信息，请跳转至[缓冲与存储](/fluentbit/administration/buffering-and-storage.md)部分。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hulining.gitbook.io/fluentbit/concepts/buffering.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
