Comments (4)
Huge Thanks for sharing it.
I found the problem, is_locked
function reserved a connection. So 100 concurrent is_locked
coroutines blocking other operations including release lock (unlock
)
Also locking without timeout (ttl=None) was unexpected - in this case if lock did not acquire it will raise an exception without waiting for lock release.
Fixed in 5.3.1
I saw your libraries for cache too, rust based memory storage is impressive, do you mind if I decided to use it too as an alternative backend ?
And also could you please share your results of benchmarks or share the repo with code?
from cashews.
Great, then I can continue my benchmarks. Feel free to use Theine as your backend, my Cacheme is doing the same.
I'm still refactoring my Cacheme, this is the results currently:
https://github.com/Yiling-J/cacheme/blob/refactor/reduce_overhead/benchmarks/trace.py
Redis GET means how many redis get command encountered and Load Hits is how many times the slow load function called.
totaly 200k requests and use a zipf generator to generate numbers. Aiocache-2 is aiocache_stampede decorator and cashews-2 is lock=True
1k concurrency
Time | Redis GET | Load Hits | |
---|---|---|---|
Cacheme | 30 s | 166454 | 55579 |
Aiocache | 46 s | 200000 | 56367 |
Aiocache-2 | 63 s | 256492 | 55417 |
Cashews | 51 s | 200000 | 56920 |
cashews-2 | x | x | x |
100k concurrency
Time | Redis GET | Load Hits | |
---|---|---|---|
Cacheme | 30 s | 60990 | 56782 |
Aiocache | 80 s | 200000 | 125085 |
Aiocache-2 | 178 s | 326417 | 65598 |
Cashews | 88 s | 200000 | 87894 |
cashews-2 | x | x | x |
from cashews.
fix confirmed, this is the result for locked cashews:
1k: redis count 200000, load count 55425, spent 137.26466012001038s
100k: redis count 200000, load count 55348, spent 236.61019372940063s
from cashews.
Thanks for sharing
from cashews.
Related Issues (20)
- Timeout and Cancelled errors HOT 6
- Utilizing Functions as Key Generators HOT 3
- [Migration] [User experience] An exception must be raised if `cache.setup()` was not called HOT 2
- [removed by author]
- A wrong exception is raised when `prefix` from the setup does not match a prefix in a passed `key` HOT 2
- Is the `cache-control` header set? HOT 9
- 'coroutine' object has no attribute 'execute_command' - Client Side Caching HOT 4
- Does cashews need handle `IndexError` in `handle_message` in "redis/asyncio/client.py"? HOT 3
- AttributeError: 'Redis' object has no attribute '_client' HOT 4
- "No connection available" errors with redis-py 5.0.1 HOT 3
- Middleware to add "X-From-Cache" in response header throws AttributeError HOT 1
- Unable to disable cache by providing "enable=0" or "disable=1" in cache setup HOT 4
- Improve docs HOT 1
- Templated tags with None values throw TagNotRegisteredError HOT 1
- 'cache' is not declared in __all__ HOT 2
- Provision to skip caching immediately if not able to make connection with Redis HOT 4
- Not working with GCP MemmoryStore (Redis) - unknown command 'CLIENT' HOT 2
- Getting TagNotRegisteredError when my key have special characters (Using custom decorator) HOT 4
- Key template context
- TypeErrors when using CacheEtagMiddleware HOT 3
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 cashews.