Buffering to disk based on health status #13828
-
Hello Team, We have a case where we cannot continuously write to disk for buffering the logs(being streamed out from http/tcp/udp) because of certain hardware limitations. To address this case we will need to persist logs in the disk space of the host system only when streaming is not possible i.e., when the health status of the down stream vector instance is bad. Can you suggest any solution that would come handy to address this case. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
👋🏻 Just to understand the use case better: what's the limitation around not being able to continuously write to disk? Space, I/O, wear on the storage device, etc? |
Beta Was this translation helpful? Give feedback.
-
In the case where minimizing disk write activity overall is preferred, we do have an experimental feature you can try out: overflow buffers. Normally, you would choose between either in-memory or disk buffers, and deal with the trade-offs of whichever one you picked, but overflow buffers allow you to compose a buffer topology consisting of multiple buffer stages. An additional This feature is still experimental, and we have some issues around actually documenting it (since it's a rather advanced feature), but here's an example of what it might look like to configure: [sinks.http]
type = "http"
...
# This first stage of the buffer is an in-memory buffer that can hold 500 events. We set it to
# "overflow" into the disk buffer in the second stage rather than block or drop.
[[sinks.http.buffer]]
type = "memory"
max_events = 500
when_full = "overflow"
# This second stage of the buffer is a disk buffer that can hold up to 1GiB. Once this stage fills
# up, though, we have to block.
[[sinks.http.buffer]]
type = "disk"
max_size = 1073741824
when_full = "block" This configures the All of the same caveats apply to each stage of the buffer, such as the disk buffer still having files on disk even if all events have been drained and processed, and so on. |
Beta Was this translation helpful? Give feedback.
In the case where minimizing disk write activity overall is preferred, we do have an experimental feature you can try out: overflow buffers.
Normally, you would choose between either in-memory or disk buffers, and deal with the trade-offs of whichever one you picked, but overflow buffers allow you to compose a buffer topology consisting of multiple buffer stages. An additional
when_full
option calledoverflow
instructs the buffer to overflow events to the next buffer in the topology if it cannot currently accept any more events.This feature is still experimental, and we have some issues around actually documenting it (since it's a rather advanced feature), but here's an example of what i…