ChainSafe / ChainSafe/forest

Expose caches capacity

Open
#2,469 0 comments 0 reactions 0 assignees View on GitHub
Node Priority: 4 - Low Type: Enhancement
Dominant language
Rust
Stars
697
Forks
200
Avg merge
1d 5h
Merged PRs (30d)
65

Description

**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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.