Open anosulchik opened 5 months ago
i'm seeing the same thing
We had simplescaleable running and backends had 2gig of memory. After bloom filters enabled they are OOMing with 22gig with no end in sight. Is there a good way to figure out how much memory is needed?
Hi, Loki beginner here, can I pick this one?
So I used the latest release from main via dockerhub and the compactor issue causing OOM has now gone away
I guess we are witing for release since all main or master builds will last only 6 months.
Hi @anosulchik Thanks for reporting. I'm amazed that you manage to run a 850TB/month cluster in SSD mode :)
We are indeed aware of memory problems with the bloom compactor component. However, since 3.0.0 we've made some significant changes to how bloom block are written, which should mitigate these problems in the future.
@mzupan The effect you're experiencing is likely that we a) limit the maximum bloom size (https://github.com/grafana/loki/pull/12796) and b) writing multi-part bloom pages (https://github.com/grafana/loki/pull/13093)
The reason for the OOMing of the bloom compactors is that the bloom filter is written in memory first. A high volume (and high entropy in terms of log data) stream can cause to create a bloom filter that does not easily fit into memory. Scalable bloom filters are layered, and each layer added increases exponentially in size. Now with the ability of writing multi-part bloom pages (multiple bloom filters for a single stream), this should not be a problem any more.
Additionally to the core changes of the binary format, we are also in the process of refactoring the bloom compactor into two separate components: a planner and a set of builders, see these PRs https://github.com/grafana/loki/pulls?q=is%3Apr+is%3Aclosed+author%3Asalvacorts+%22refactor%28blooms%29%22
Hi @chaudum,
Thank you for the detailed explanation regarding the bloom compactor issues and improvements.
I have a couple of questions:
How can we stay updated on what the Grafana team is currently working on and the features that will be released in the future? Is there a public platform where these discussions take place?
As an OpenTelemetry contributor, I'm keen to contribute to Grafana Loki. I am currently working on some bugs reported on GitHub. Bloom compaction is particularly interesting to me. Is it possible to assign me some small tasks related to this? Or, if there are other features that need attention, I would be happy to help.
Thank you for your guidance!
I wanted to give some feedback about blooms as well. We are running the latest chart with Loki 3.2 in SSD with ingestion around 1TB/day. Launched blooms as per grafana docs page with exact settings mentioned, and it kind of works. "kind of," because there are quite a few uncertainties about it.
Firstly, even though we see lots of activity in Bloom gateways, the progress of Bloom building is unclear, so providing the dashboard for the builder and planner instead of the compactor would be crucial here. (i.e. what would be the alternative calculation to loki_bloomcompactor_progress
)
Secondly, it isn't easy to calculate the needed resources for it. Sometimes it finishes building with no OOMs, and sometimes it OOMing even with 10gb of memory (hpa max for backend up to 40 pods with 10gb limits)
Another thing to mention is that with CPU-based hpa enabled, sometimes pod building the bloom could be terminated, reducing its efficiency. Also, sometimes, the cache size could grow larger than the PVC attached.
We're running Loki 3.0.0 for our production environment that ingests 300-400 MB/s of logs, and recently we enabled bloom compaction to explore bloom filtering for "needle in a haystack" queries e.g.
{<labels>} | "somestring"
. The first thing we noticed is poor performance of bloom compaction, its progress never goes more than 15% (see screenshots) that is caused by the two reasons I've outlined below. At the same time overall ingestion is OK and we're successfully flushing ingested that eventually reaches s3, so low performance is related to bloom compaction only. We understand that bloom filtering is experimental feature but it shows a lot of potential to speed up certain type of queries and we'd like to pursuit the opportunity to get it working with proper configuration.Reason of compactor crashes:
Loki config:
loki-backend
runs 12 pods with the following resources allocated (it was increased dramatically to address OOMs):