Comments (2)
Note: As soon as I get the first contract offer I will open all leveldbs one by one. A few minutes later I have 1028 open files and they are never closed as well. I would expect that this is needed to get the used space once. Every new request should not open all leveldbs again. It would be better to cache the size of each leveldb and update on change.
root@storj:~# ls -l /proc/416/fd | grep 'storjshare' | wc -l
350
root@storj:~# ls -l /proc/416/fd | grep 'storjshare' | wc -l
398
root@storj:~# ls -l /proc/416/fd | grep 'storjshare' | wc -l
427
root@storj:~# ls -l /proc/416/fd | grep 'storjshare' | wc -l
450
root@storj:~# ls -l /proc/416/fd | grep 'storjshare' | wc -l
469
root@storj:~# grep 'download\|upload\|contract offer' .storjshare/storjshare/logs/188071ba7cfd974a9e47b59e24b0737ebf845db3.log
{"level":"debug","message":"received contract offer...","timestamp":"2017-02-28T16:16:01.155Z"}
{"level":"debug","message":"received contract offer...","timestamp":"2017-02-28T16:16:14.497Z"}
{"level":"debug","message":"received contract offer...","timestamp":"2017-02-28T16:16:24.483Z"}
root@storj:~# ls -l /proc/416/fd | grep 'storjshare' | wc -l
637
root@storj:~# ls -l /proc/416/fd | grep 'storjshare' | wc -l
689
root@storj:~# ls -l /proc/416/fd | grep 'storjshare' | wc -l
736
root@storj:~# ls -l /proc/416/fd | grep 'storjshare' | wc -l
1028
I am not able to proof that expectation. Feel free to fix it as well. I will test it as soon as unused leveldbs are getting closed. That will allow me to see the result after the second contract offer.
from kfs.
After some testing and one small addition to KFS in v3.1.3, I can confirm that this issue is in storj-lib
and not in KFS.
Storj is using Btable#stat()
inefficiently. It never calls it with the file key (which will only open the single Sbucket
the corresponds to that key), so instead it measures the entire store, opening all of the buckets as you observed.
I can also confirm that KFS does emit the idle event and does close the bucket afterwards. However, the way the Storj is keeping track of capacity available, it is measuring the entire store after every contract save/update/etc - this causes all the buckets to stay open, since every time a PUBLISH message is received, we call that causing the pending operations for each bucket to be > 0 when the idle state is checked thus leaving the bucket open.
Fixing this will require some refactoring to the StorageManager
and StorageAdapter
classes in Storj. Let's reopen the issue in core and we will work on it this week.
from kfs.
Related Issues (20)
- After some time of running HOT 2
- Optimize for SMR tech drives & Raid 5/6 backed storage HOT 1
- Disable Compression HOT 12
- Uncaught TypeError: Data must be a string or a buffer HOT 7
- Too many open files HOT 10
- IO error: lock /root/.storjshare/sharddata.kfs/112.s/LOCK: already held by process HOT 13
- Using [email protected] result with Syntax error: Unexpected token HOT 3
- Used space query keeps 1028 files open HOT 2
- The media in the drive may have changed HOT 1
- Error when stopping and restarting Daemon w/ google-drive-ocamlfuse HOT 1
- Another Error with google-drive-ocamlfuse when running Storj_Farmer_Contracts.js HOT 2
- Error: too many open files HOT 1
- Corrupted database HOT 7
- Uncaught error on events.js too many files opened HOT 1
- LevelDB alternative HOT 1
- RocksDB support HOT 2
- Support larger shards HOT 1
- Feature: Allow farmers to merge nodes HOT 1
- Feature: support partial read in kfs 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 kfs.