logstash-filter-geoip icon indicating copy to clipboard operation
logstash-filter-geoip copied to clipboard

Cache has no eviction policy - when it fills up, it never changes

Open prehor opened this issue 8 years ago • 2 comments

It seems that geoip plugin has inconsistent cache size option:

  • Docs says that we should use option lru_cache_size only (see https://www.elastic.co/guide/en/logstash/current/plugins-filters-geoip.html)
  • Geoip plugin declares two options for cache size setting: cache_size and lru_cache_size (see https://github.com/logstash-plugins/logstash-filter-geoip/blob/master/lib/logstash/filters/geoip.rb#L107)
  • Geoip plugin uses only cache_size option (see https://github.com/logstash-plugins/logstash-filter-geoip/blob/master/lib/logstash/filters/geoip.rb#L143), lru_cache_size option is not used anywhere.

prehor avatar Dec 10 '16 15:12 prehor

This seems to have come to pass because the cache is no longer an LRU cache for GeoIP2. So cache_size in lieu of lru_cache_size is probably correct and the documentation is incorrect. But there's also still an underlying problem of how to evict entries.

I've opened an issue with MaxMind to see if it's possible to implement an eviction policy in their default cache.

joewreschnig avatar Apr 12 '17 09:04 joewreschnig

The question which cache size argument we should use was resolved by @jsvd in #149.

We still have to solve the cache eviction, so I changed the subject of this issue.

prehor avatar Feb 21 '19 11:02 prehor