badger icon indicating copy to clipboard operation
badger copied to clipboard

Why v3 doesn't have FileIO mode

Open zjiek327 opened this issue 1 year ago • 2 comments

Question.

Version: v3 System: centos7 Go Version: go1.18 linux/amd64

In our scenario, we need to traverse the entire database, but the memory usage is too much. We want to reduce the memory usage by configuring parameters, but modifying the parameters does not reduce the memory usage too much. I modified the read method (not using mmap) to save nearly 50% memory.

Why doesn’t v3 use FileIO mode?

Using mmap is indeed much faster, but you can use memory cache to improve the efficiency of hits, because our scene’s hot data accounts for the majority, using FileIO mode and 20% memory cache can also save 30% compared to before of memory.

Using v2 to traverse the entire database memory usage is also very large, even if the FileIO mode is used

zjiek327 avatar Mar 23 '23 08:03 zjiek327

This seems related to https://github.com/dgraph-io/badger/issues/1841 and we plan to look into this next month.

mangalaman93 avatar Mar 23 '23 09:03 mangalaman93

Thank you very much!

I want to know if there is any plan for v3 to support FileIO mode.

zjiek327 avatar Mar 23 '23 10:03 zjiek327

This issue has been stale for 60 days and will be closed automatically in 7 days. Comment to keep it open.

github-actions[bot] avatar Jul 19 '24 02:07 github-actions[bot]