From 2ad8989cd2c65fee8700f322a9a139f4364b978a Mon Sep 17 00:00:00 2001 From: Matthias Rampke Date: Thu, 5 Mar 2020 09:34:47 +0000 Subject: [PATCH] Add changelog & readme entries for #281 explain the tradeoffs for the cache strategies based on this comment: https://github.com/prometheus/statsd_exporter/pull/281#issuecomment-573103251 Signed-off-by: Matthias Rampke --- CHANGELOG.md | 1 + README.md | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77c7247..c3d19d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## 0.15.0 / unreleased * [ENHANCEMENT] Allow setting granularity for summary metrics ([#290](https://github.com/prometheus/statsd_exporter/pull/290)) +* [ENHANCEMENT] Support a random-replacement cache invalidation strategy ([#281](https://github.com/prometheus/statsd_exporter/pull/281) To facilitate the expanded settings for summaries, the configuration format changes from diff --git a/README.md b/README.md index 830b57c..bc6e861 100644 --- a/README.md +++ b/README.md @@ -431,10 +431,11 @@ There is a cache used to improve the performance of the metric mapping, that can The cache has a default maximum of 1000 unique statsd metric names -> prometheus metrics mappings that it can store. This maximum can be adjust using the `statsd.cache-size` flag. -If the maximum is reached, entries are rotated using the [least recently used replacement policy](https://en.wikipedia.org/wiki/Cache_replacement_policies#Least_recently_used_(LRU)). +If the maximum is reached, entries are by default rotated using the [least recently used replacement policy](https://en.wikipedia.org/wiki/Cache_replacement_policies#Least_recently_used_(LRU)). This strategy is optimal when memory is constrained as only the most recent entries are retained. -If you are using this exporter to reduce the cardinality of your data, a high maximum cache size can be a costly use of memory. +Alternatively, you can choose a [random-replacement cache strategy](https://en.wikipedia.org/wiki/Cache_replacement_policies#Random_replacement_(RR)). This is less optimal if the cache is smaller than the cacheable set, but requires less locking. Use this for very high throughput, but make sure to allow for a cache that holds all metrics. +The optimal cache size is determined by the cardinality of the _incoming_ metrics. ### Time series expiration