[#419] cmd/node: Cache containers read from sidechain
Implement LRU cache for values read from the network. Implement LRU cache of containers read from sidechain. Use it as a container storage in neofs-node app. Current cache size is set to 100, TTL is 30s (constants). Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
ed808c3f1b
commit
34a51ed38b
2 changed files with 111 additions and 1 deletions
|
@ -53,7 +53,7 @@ func initContainerService(c *cfg) {
|
|||
wrap, err := wrapper.New(cnrClient)
|
||||
fatalOnErr(err)
|
||||
|
||||
c.cfgObject.cnrStorage = wrap // use RPC node as source of containers
|
||||
c.cfgObject.cnrStorage = newCachedContainerStorage(wrap) // use RPC node as source of containers (with caching)
|
||||
c.cfgObject.cnrClient = wrap
|
||||
|
||||
localMetrics := &localStorageLoad{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue