-
Notifications
You must be signed in to change notification settings - Fork 510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distributed cache feature using Redis #518
Distributed cache feature using Redis #518
Conversation
Signed-off-by: Anurag Wagh <a9raag@gmail.com>
Signed-off-by: Anurag Wagh <a9raag@gmail.com>
Signed-off-by: Anurag Wagh <a9raag@gmail.com>
Signed-off-by: Anurag Wagh <a9raag@gmail.com>
Signed-off-by: Anurag Wagh <a9raag@gmail.com>
Signed-off-by: Anurag Wagh <a9raag@gmail.com>
Signed-off-by: Anurag Wagh <a9raag@gmail.com>
Signed-off-by: Anurag Wagh <a9raag@gmail.com>
…rison Signed-off-by: Anurag Wagh <a9raag@gmail.com>
Signed-off-by: Anurag Wagh <a9raag@gmail.com>
Signed-off-by: Anurag Wagh <a9raag@gmail.com>
Signed-off-by: Anurag Wagh <a9raag@gmail.com>
Signed-off-by: Anurag Wagh <a9raag@gmail.com>
@SimFG
|
@a9raag ok, I have rerun it |
… to include memory cache config Signed-off-by: Anurag Wagh <a9raag@gmail.com>
Signed-off-by: Anurag Wagh <a9raag@gmail.com>
Signed-off-by: Anurag Wagh <a9raag@gmail.com>
Signed-off-by: Anurag Wagh <a9raag@gmail.com>
Signed-off-by: Anurag Wagh <a9raag@gmail.com>
@SimFG it failed again |
Signed-off-by: Anurag Wagh <a9raag@gmail.com>
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## dev #518 +/- ##
==========================================
- Coverage 94.05% 93.89% -0.16%
==========================================
Files 94 95 +1
Lines 3920 4014 +94
==========================================
+ Hits 3687 3769 +82
- Misses 233 245 +12
|
Signed-off-by: Anurag Wagh <a9raag@gmail.com>
Signed-off-by: Anurag Wagh <a9raag@gmail.com>
…t_data_manager` Signed-off-by: Anurag Wagh <a9raag@gmail.com>
@SimFG apologies if I keep bugging you but the Unit Test workflow failed again 😭 Here's the error log
|
Hi @SimFG and @xiaofan-luan |
@a9raag great!!! i will check it today |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: a9raag, SimFG The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Distributed Cache using Redis #496
Feature for distributed cache. This allows us to store
keys
in Redis key-value store.Sorry, it took a while I spent too much time thinking about a design for this and how it will integrate into GPTCache's existing code base.
I have also attached a high-level design of how Distributed Cache works.
Notes
A couple of notes about how the eviction will work based on different scalar storage configurations:
Scenario 1:
Scalar Storage is MongoDB,
Eviction Base is Redis.
Then the keys will be stored in Redis, and cache call back will update the TTL.
Scenario 2:
Scalar Storage is Redis,
Eviction Base is also Redis,
Then storing keys separately becomes redundant since Redis eviction is based on Memory usage rather than the number of keys.
Also, we'll be fetching values multiple times both while getting scalar data and while hitting cache callback, and it will add network overhead.
To tackle this I created a NoOpEviction implementation (which skips cache operations) since,