Comments (3)
You'll have to test your application to know the impact. Writes to files are done to reduce the time taken writing to the database. But writes don't block reads. If your writes are rare enough, it won't matter. Just measure.
Eviction does not refer to the use of files. When eviction takes place, the item is deleted from the cache entirely.
from python-diskcache.
There’s no functionality for that exactly built in today.
One option is to increase the minimum disk file size to something larger or very large. By doing so, more values will be stored directly in sqlite itself and no extra files will be used.
A more complex option is to create a custom eviction scheme. This would require inheriting from Cache and implementing the logic for culling items. You would need to read through the code to understand how. One challenge in this design is knowing the number of files used. I don’t believe that’s tracked currently.
Another option would be to create a custom Disk that somehow packs files together. Maybe you could put a zip file in subdirectories and pack values together in a single zip file. No idea what the performance would be like for reads/writes with that approach.
from python-diskcache.
The first option you mention might be a good and easy solution for now. Is there any downside to increasing the minimum disk file size? E.g. slower current reads/writes, or more frequent corruption.
Regarding the eviction scheme, am I correct in saying that it decides how to move entries between the *.val
and cache.db
files? It sounds like the "none" policy would have the same effect as a very large minimum disk file size, potentially keeping everything in cache.db
. However, it seems that changing the eviction logic would postpone the problem, but not fix it.
I'm afraid zipping would be too slow, at least for my application.
Thanks for the clarifications.
from python-diskcache.
Related Issues (20)
- Deque `peekleft` blocks infinitely after corruption(?) HOT 18
- No real-time synchronization between writing data and reading data in different processes. HOT 1
- RFE: is it possible to start making github releases?🤔 HOT 2
- Deque with JSONDisk throws TypeError: a bytes-like object is required, not 'int' HOT 1
- [Feature Request] Allow iterkeys method to yield value or tag along with key?
- High memory usage with multiple threads HOT 3
- [Bug] Fetching an item while writing the item into Cache HOT 4
- "unable to open database file" with Python 3.11 and PySide6 threads HOT 9
- Mark the distributed package as typed HOT 1
- Long-lived cache management HOT 2
- PR for fork deadlock HOT 1
- Can this awasome add the range selection Feature? HOT 2
- PicklingError: logger cannot be pickled HOT 6
- Q: Config for in-memory shared cache HOT 8
- Use local OS' path separator HOT 3
- Cannot change JSONDisk compression level HOT 2
- Memoize key isn't always invertible
- support pandas.DataFrame in cache.memoize()
- Protect Against Repeated KeyboardInterrupt Signals HOT 1
- Error during reset
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 python-diskcache.