forest icon indicating copy to clipboard operation
forest copied to clipboard

Expose caches capacity

Open elmattic opened this issue 2 years ago • 0 comments

Issue summary

Lotus can configure the capacity of its caches like the tipset cache or the index cache through environment variables (respectively LOTUS_CHAIN_TIPSET_CACHE and LOTUS_CHAIN_INDEX_CACHE).

We would like to expose similar functionality in Forest. Forest configuration file can be a way to achieve that.

Monitoring at what speed the different caches are filling up is important, so Prometheus metrics should be added for that purpose (current capacity has been implemented for some, but we would like to pass the current length and max length of the underlying HashMap).

Task summary

  • [ ] Find all relevant caches that make sense to expose to the user
  • [ ] Implement configuration using a new CacheConfig struct
  • [ ] Add current length, max length to Prometheus metrics

Acceptance Criteria

  • [ ] The capacity of the different caches can be customised
  • [ ] Caches values are updated correctly in Grafana Dashboard

Other information and links

https://lotus.filecoin.io/lotus/configure/defaults/#environment-variables

elmattic avatar Jan 24 '23 16:01 elmattic