node: Configure of the container cache size #1375
No reviewers
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
7 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#1375
Loading…
Reference in a new issue
No description provided.
Delete branch "achuprov/frostfs-node:feat/add_container_cache_config"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fetching the list of containers takes time. Let's add a container cache size setting
Signed-off-by: Alexander Chuprov a.chuprov@yadro.com
fa0480a3b6
to67acdb6874
@ -80,3 +80,3 @@
}
if c.cfgMorph.cacheTTL <= 0 {
if c.cfgMorph.cacheTTL <= 0 || c.cfgMorph.containerCacheSize == 0 {
It seems wrong, the value of
containerCacheSize
should not affect other caches.fixed
What is the behaviour for
containerCacheSize == 0
now?Now the behavior is similar
c.cfgMorph.cacheTTL=0
forcnrSource
@ -80,6 +80,7 @@ morph:
cache_ttl: 15s # Sidechain cache TTL value (min interval between similar calls). Negative value disables caching.
# Default value: block time. It is recommended to have this value less or equal to block time.
# Cached entities: containers, container lists, eACL tables.
container_cache_size: 1000 # container_cache_size is responsible for the number of containers that are in the cache.
is responsible for the number
->is the maximum number
@ -31,2 +31,4 @@
// FrostfsIDCacheSizeDefault is a default value of APE chain cache.
FrostfsIDCacheSizeDefault = 10_000
// ContainerCacheSizeDefault is a default value of size container cache.
// ContainerCacheSizeDefault represents the default size for the container cache.
@ -32,1 +32,4 @@
FrostfsIDCacheSizeDefault = 10_000
// ContainerCacheSizeDefault is a default value of size container cache.
ContainerCacheSizeDefault = 100
Is there any estimate on the size of the container? Maybe 100 is a very small (or vice versa, a very large) value?
100 is as it was before, seems like a sane default to me.
67acdb6874
toc63f4d6ef5
c63f4d6ef5
to3052d113e8
Can you please add some comments to the PR description and to the commit message on what this PR is about?
3052d113e8
to24897daacb
24897daacb
to549b1fe2d5
549b1fe2d5
to97ce5ed4a3
97ce5ed4a3
tobe52657175
@ -90,2 +89,2 @@
cachedContainerStorage := newCachedContainerStorage(cnrSrc, c.cfgMorph.cacheTTL)
cachedEACLStorage := newCachedEACLStorage(eACLFetcher, c.cfgMorph.cacheTTL)
cachedContainerStorage := cnrSrc
if c.cfgMorph.containerCacheSize > 0 {
Why this line added?
@acid-ant is right. If we add this check, then we must be able to support backward-combability with already deployed systems - we'll accidently disable container caching. Of course, we can fixate this parameter in config for frostfs-storage update but the way simpler is to introduce default value for
containerCacheSize
@aarifullin We have the constant
ContainerCacheSizeDefault=100
. Therefore, the default behavior will not change.@acid-ant We don't need create a subscribers if the
containerCache
is disabled.@ -92,0 +89,4 @@
cachedContainerStorage := cnrSrc
if c.cfgMorph.containerCacheSize > 0 {
// use RPC node as source of Container contract items (with caching)
cachedContainerStorage := newCachedContainerStorage(cnrSrc, c.cfgMorph.cacheTTL, c.cfgMorph.containerCacheSize)
You've created
cachedContainerStorage
but don't use it forc.cfgObject.cnrSource
. Is it intentional?fixed typo
be52657175
to4c77e17b4f
4c77e17b4f
to81c63a8cf2