Comments (9)
How many threads are there?
try moving the cache reference to a single global reference. Opening and closing it a gain and again in fast succession from multiple threads is likely to cause issues.
from python-diskcache.
How many threads are there?
Something from 1 to 10, I have one thread per graph so it depend on usage.
The more I have threads the quicker I reach the maximum fd per process.try moving the cache reference to a single global reference. Opening and closing it a gain and again in fast succession from multiple threads is likely to cause issues.
Unless I missed something it's already what I do.
To give more context, with python 3.10, 3.9 it works perfectly (several days). What I see with Python 3.11 is that sometimes a thread leaks a file descriptor (doesn't look systematic) so I need repeat quite a lot of requests to reach 1024 opened files.
The way it works, is for each graph I have a thread that listen for data requests. A data request correspond to any user interaction with the graph that modifies the X axis range (zoom, pan).
There is only one thread per graph and it is always the same, I mean I create only one thread at graph creation and this thread handles all data requests for this graph and this thread is supposed to use the single shared diskcache instance.
Is that possible that somehow diskcache or sqlite3 reopen the database because it lost the previous fd from within the same thread?
from python-diskcache.
Is that possible that somehow diskcache or sqlite3 reopen the database because it lost the previous fd from within the same thread?
I donβt think so.
Sounds like a problem at a lower level than DiskCache.
from python-diskcache.
@grantjenks thanks for your help, I will continue investigating. I must be able to build a simple reproducer at some point.
from python-diskcache.
Related Issues (20)
- Is this project still in active development? HOT 1
- sqlite3.DatabaseError: database disk image is malformed HOT 2
- Quesion about cache.close() and cull() HOT 2
- DiskCache Dropping Items HOT 5
- Native async implementation HOT 1
- Controlling the number of files generated by Cache HOT 3
- in Cache._cull(), cull_limit appears to be prescriptive vs. a limit & in Cache.cull(), 10 files are deleted at a time HOT 2
- Enable custom type serialization in `JSONDisk` HOT 2
- diskkache.Cache.get ignoring read=True parameter HOT 2
- 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
- Mark the distributed package as typed HOT 1
- Long-lived cache management HOT 2
- PR for fork deadlock HOT 1
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.