Repository navigation
|
I tried controlling the batch at the sink level but still the amount of memory is not getting controller, |
Replies: 2 comments 2 replies
|
Hi @yjagdale, this is a great question. Are you referring to a process wide limit or per component? Regardless, here is some information that you might find useful. systemd service managerIf your Vector instance runs as a Configure in-memory buffersOf course this is not really a process (or even a component) wide limit, but might be helpful: Tip For monitoring memory usage you can use |
|
The OOMKill pattern you're seeing with Kafka → metrics → Prometheus is a well-known constraint in Vector's architecture — @jszwedko is right that there's no global backpressure mechanism yet. A few things worth trying that go beyond the standard buffer tuning: 1. Limit Kafka fetch size at the librdkafka level This slows ingestion at the source before events enter Vector's internal pipeline, which is the only real lever for memory control right now. 2. Set tight memory buffer limits per sink with [sinks.prometheus_out]
type = "prometheus_remote_write"
buffer.type = "memory"
buffer.max_events = 500
buffer.when_full = "drop_newest"Dropping newest (rather than blocking) prevents the sink buffer from growing unboundedly when Prometheus is slow to accept writes. 3. Cap the On the broader architecture — the root issue is that Vector applies backpressure at the buffer level rather than at the source read level, which means a burst of Kafka messages can flood the in-flight pipeline faster than the Prometheus sink can drain it. The systemd For what it's worth, this is one of the core design tradeoffs we revisited when building WarpParse — applying backpressure at the read level so that memory stays bounded even when downstream sinks are slow. Happy to share more detail on how that works if it's useful. |
I think you may be interested in this feature request: #8792.
There is no way, at the moment, to globally limit Vector memory use in a way that Vector will apply back-pressure rather than just OOM. There are some knobs that can be turned like
bufferlimits mentioned above. You mentioned Kafka as the source so you may also be interested in some of the options mentioned in https://github.com/confluentinc/librdkafka/blob/master/CONFIGURATION.md