https://cerbos.dev logo
#help
Title
# help
a

Andrew Young

06/22/2023, 4:47 PM
@Charith (Cerbos) thanks for replying to my email. i have a few other questions related to the cache. 1. Does the Reload Store simply clear the cache on an instance? 2. Does reloading taking longer the more policies that you have defined in the store? i.e. what does the big-O runtime look like? 3. Would be nice to have an endpoint with the ability to purge a specific item from the cache so that we can get the best of both worlds: a longer
cacheDuration
along with a more granular way of keeping the cache fresh. (this is more of a feature request vs. a question)
c

Charith (Cerbos)

06/22/2023, 4:56 PM
Hey! Welcome to the Cerbos Slack community. Answers below. 1. Yes 2.
O(cache_size)
. It doesn't depend on the number of policies you have in your store -- only the number that's currently cached. 3. Thanks for the suggestion. We'll consider it.
One thing to note is that in most cases, the compile time of Cerbos policies is negligible. So, clearing the cache doesn't have a drastic effect on performance.
a

Andrew Young

06/22/2023, 5:22 PM
so is it generally ok to call Reload Store as frequently as polices are added?
potentially multiple times per minute for us since we need near-realtime updates
c

Charith (Cerbos)

06/22/2023, 5:25 PM
It should be fine in general. I'd recommend monitoring your response times to see whether it's having a negative impact. BTW, you only need to reload the store if you have multiple instances. On a single instance, when you use the Admin API the affected policies are automatically refreshed.
a

Andrew Young

06/22/2023, 5:26 PM
yes, we plan on running multiple instances for availability/fault tolerance reasons
do you have more info on how to set up this deployment model?
is it simply just pointing all the instances to the same data store?
c

Charith (Cerbos)

06/22/2023, 5:27 PM
Yes. Just share the same configuration file with all instances.
a

Andrew Young

06/22/2023, 5:28 PM
ok thanks for your help!
8 Views