Enrich cache default can usage a ton of memory #120021
Labels
>bug
:Data Management/Ingest Node
Execution or management of Ingest Pipelines including GeoIP
Team:Data Management
Meta label for data/management team
v8.16.0
v8.17.0
Elasticsearch Version
8.16+
Installed Plugins
No response
Java Version
bundled
OS Version
any
Problem Description
In 8.16 we changed the default for
enrich.cache_size
from1000
to1%
which should allow us to more carefully cache. The trouble is that we don't account for a few things in the cache's weight:Map<String, Object>
which is usually much larger.When you combine the first two, queries pointing to no documents in the enrich index cost 0 bytes. So, no matter the limit you configure, you can fill up memory with them.
But, yeah, I think we should include the size of the cache key. And Include an estimate of the cost of the List we store in the cache - even if it's empty. And, finally, I think we should uplift the cost of the exploded map. Or we should cache the serialized copy. I'm not entirely sure if it's worth a cost for the cache entry itself. That bit I don't know.
Steps to Reproduce
See above.
Logs (if relevant)
@nik9000 has a heap dump of a node the OOMed full of cache entries of empty results lists.
The text was updated successfully, but these errors were encountered: