lib/storage: tune cache sizes according to production workload

This commit is contained in:
Aliaksandr Valialkin 2021-07-05 15:13:56 +03:00
parent 8f973e34fb
commit d0c830039d

View file

@ -175,9 +175,9 @@ func OpenStorage(path string, retentionMsecs int64, maxHourlySeries, maxDailySer
// Load caches.
mem := memory.Allowed()
s.tsidCache = s.mustLoadCache("MetricName->TSID", "metricName_tsid", mem/3)
s.tsidCache = s.mustLoadCache("MetricName->TSID", "metricName_tsid", int(float64(mem)*0.35))
s.metricIDCache = s.mustLoadCache("MetricID->TSID", "metricID_tsid", mem/16)
s.metricNameCache = s.mustLoadCache("MetricID->MetricName", "metricID_metricName", mem/8)
s.metricNameCache = s.mustLoadCache("MetricID->MetricName", "metricID_metricName", mem/10)
s.dateMetricIDCache = newDateMetricIDCache()
hour := fasttime.UnixHour()