fastcache icon indicating copy to clipboard operation
fastcache copied to clipboard

Support timeout for SaveToFile/SaveToFileConcurrent

Open ehnuje opened this issue 5 years ago • 2 comments

In our project, fastcache consumes 40~50GB and it takes about 7 minutes to save the cache to the disk, which is too long. As we can get benefit from saving only partial part of the cache to the disk, it would be nice if SaveToFile/SaveToFileConcurrent accepts Context to support timeout. How do you think?

ehnuje avatar Sep 15 '20 00:09 ehnuje

I think it is better limiting the size of the cache, so it could be saved to disk in reasonable time. I see little sense in partially saved cache.

valyala avatar Sep 21 '20 23:09 valyala

I think it is better limiting the size of the cache, so it could be saved to disk in reasonable time. I see little sense in partially saved cache.

@valyala We're currently saving the nodes of a tree to fastcache. As the nodes close to the root are frequently accessed, partially saved cache can be helpful. I think there might be similar cases like ours. How do you think?

ehnuje avatar Sep 22 '20 04:09 ehnuje