Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

MaxCacheSizeInMegabytes with HasPersistedState = true #17

Open
Vikhyat08 opened this issue Aug 10, 2020 · 4 comments
Open

MaxCacheSizeInMegabytes with HasPersistedState = true #17

Vikhyat08 opened this issue Aug 10, 2020 · 4 comments

Comments

@Vikhyat08
Copy link

Vikhyat08 commented Aug 10, 2020

I am using service fabric distributed cache with a stateful service having HasPersistedState = true.
I believe HasPersistedState will allow me to have reliable collections backed by disk.
If I set MaxCacheSizeInMegabytes to 1000, does it mean all 1000 MB data is in memory backed by disk. Or does it mean Service fabric reliable collection will manage memory footprint having some objects in memory and rest all in disk.

Also, I see in the example HasPersistedState is false but replicationSize is set to 3. Why would we want replication if we are not backing the data to store there would be no way to recreate state in a node because of no snapshots?

@lurock
Copy link
Contributor

lurock commented Aug 10, 2020

It means Service fabric reliable collection will manage memory footprint having some objects in memory and rest all in disk. As far as the replicationSize that is up to you. You would need to refer to the docs on Reliable collections to see if there is any advantage when not backing up the state.

@oargaruna
Copy link

If HasPersistedState = false, and all the data is kept in-memory, how is the cache limit being enforced?

Is it possible for the memory footprint to increase beyond the limit set by MaxCacheSizeInMegabytes?

@lurock
Copy link
Contributor

lurock commented Aug 13, 2020

Is it possible for the memory footprint to increase beyond the limit. It is using that setting as a guide to start to removing the least recently used cached items from the store.

@oargaruna
Copy link

Can you add an option to impose the size limit? This will be useful for memory constrained environments.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants