by anacrolix · 2w ago · 0 comments
I wrote https://github.com/anacrolix/possum for this exact use case. It has a few rough edges but it absolutely hauls ass for caching on disk. Incidentally it uses sqlite for transaction/TTL metadata which is more suited to sqlite but it's still the bottleneck.
sqlite transaction commit overhead is too high and uncompetitive without batching but it's a design flaw specific to being multiprocess.
Or is there a better way?
So, on a filesystem?
pragma journal_mode = WAL;
pragma synchronous = normal;
pragma temp_store = memory;
pragma mmap_size = 30000000000;
pragma page_size = 32768;
pragma cache_size = -1048576;
"Rule 2. Measure."Why sqlite instead of RocksDB ?
What you need at the end of the day for a blob storage is a transactional key value store.
Which RocksDB will give you with much better throughput (and latency) and solves your transaction problem.