Comments (15)
Ttl eviction is highly valuable!
from ristretto.
We can do TTL based expiry. But load on TTL seems like a cumbersome design.
from ristretto.
Will be working on this over the next few days.
from ristretto.
hello, could I ask when would you plan to add the ttl feature? I think it is necessary
from ristretto.
@barkanido This was just merged recently. See PR #122
from ristretto.
@karlmcguire any update on this?
from ristretto.
Agreed, just invalidate items due to TTL and let the client decide.
from ristretto.
Yes we need ttl
from ristretto.
For example, I want than 1 key living 10second and after reload
from ristretto.
Will be working on this over the next few days.
May I ask when the master can join the ttl function?
from ristretto.
If I may join the discussion... It might be worth considering adding automated purging of expired items.
Ristretto currently seems to be focusing on a scenario where there is a huge amount of data, only a portion of which can be stored in pre-defined size of cache, and it is stored forever (i.e. MaxCost is reached quickly; some additional keys are tracked - NumCounters).
However, many use-cases require a TTL-driven cache, whereby you have to / are happy to cache everything as long as ... e.g. it is max 5 minutes old (e.g. for operations which tend to always be resolved within 1-2 minutes). Hence you would expect the MaxCost to be large (just in case ever needed) but the average cache size would be minimal. A go routine checking expiry times and deleting entries would be needed - and highly appreciated.
I would be happy to help with coding this. Currently it seems like karlmcguire and caofengl are already on it, but feel free to reach out to me if some extra help is needed.
from ristretto.
I think this was the original intent. wasn't it?
from ristretto.
My understanding was that the original intention was to merely add TTL as an eviction criterion, i.e. to remove expired items only when, and only to the extent that a space needs to be made for, a new item. But if a routine cleanup is already being considered then great.
from ristretto.
Re-opening since only the TTL part is done. I am not sure what the status of the reload function is.
from ristretto.
Just noticed that Manish didn't agree with the need of a reload function. I think it's a bad idea too. If you need to reload an item immediately after it's expired the client should handle it.
from ristretto.
Related Issues (20)
- [FEATURE]: Loading or Compute If key is not present
- How many bits tinyLFU uses to count access frequency? HOT 1
- [QUESTION]: Ristretto hit ratio benchmark result HOT 2
- [BUG]: <sync.Pool GC>
- [QUESTION]: Too high missed rate?
- [FEATURE]: Jemalloc 5.3.0
- [FEATURE]: use system jemalloc
- [Non-hashed key values in Item]: onEvict should send the non hashed key values HOT 1
- [BUG]: compilation reports asm error when -buildmode=plugin
- [QUESTION]: Is there any way to implement an expired map counter with ristretto?
- [QUESTION]: How can I pre warm the cache ?
- [QUESTION]: When get v.0.1.2 tag and it's release note?
- [QUESTION]: Why is Ristretto so slow and has such a small hit ratio?
- Update projects using ristretto
- [SERIOUS BUG]: negative key cache hit problem HOT 3
- [BUG]: Can't use Google's uuid.UUID (a byte array rather than slice) as a key HOT 6
- [BUG]: cost added always differ by 56 HOT 2
- new release
- Missing commits/PRs on main
- Cache configuration checks should consider negative values for `NumCounters`/`MaxCost`/`BufferItems`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ristretto.