New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added BadgerHold to Projects list #704
Conversation
I circulated the article among our team. I'll merge your PR for now. |
Hey @timshannon , reading the article. Have some comments:
The benefit of having files be immutable is that they get rsync friendly. That was an explicit requirement for LevelDB at Google. Quoting Sanjay Ghemawat (Google):
That's intended. It allows flexibility in how you want Badger to behave, and we want users to have a look at the default options and tweak them.
Interesting. That limitation is easy to fix. If you file an issue, we can follow up on that. |
Thanks for the feedback. I'll include those notes with the article, and open up an issue for the RW transactions. |
I'm also not sure about the memory issue -- doubt Badger would hold onto 8GB memory, causing OOM. I tried to run |
Sure, I'll replicate where I was seeing the issue, and open an issue with the heap profile. Keep in mind though, that my scenario was opening and closing a database file for each test. I'm not sure how real-world a scenario that is, and if it's worth spending time on. |
We do that as well, open and close DB for each test: Line 98 in e44ea26
|
Interesting. It very likely is an issue on my end then. I'll look into it and get back to you. Thanks, |
I haven't looked at them yet, but attached at the cpu.prof and mem.prof from a partial run of my test suite. I can't fun the full suite, because I run out of memory. This run is from ~120 different tests. I'll open up an issue, if I can determine that it is something in Badger that's consuming so much memory. Thanks, |
Based on this, it seems like there are a lot of in-memory tables. It looks like you might have a lot of Badger DBs open, but not closed. |
The code that wraps every single test call is here: It opens the database, runs the tests, then closes the database, and removes the directory. Is there some sort of additional cleanup that's happening on another go routine, or am I not closing the database correctly? |
Your We use cur dir: Line 99 in e44ea26
|
Yep, I thought the same thing. The process still gets killed after using all my memory when use a I'll see if I can throw together a minimal gist that can replicate this. I'm not convinced it's an issue with Badger, but I appreciate your help. Thanks, |
I presume you tried setting |
I've added some swap space and got a full run to complete. It looks like the real issue is on Update transactions. The memory seems to be properly reclaimed on the read only queries, but not on the update and delete queries. I have yet to be able to recreate this on its own outside of my library. I can open and close a bunch of databases with iterators and updates, and the memory usage stays low and constant. |
I also wrote up a quick comparison of my findings between BoltDB and Badger.
https://tech.townsourced.com/post/boltdb-vs-badger/
If you feel anything is inaccurate, let me know and I'll update my post accordingly.
Thanks,
This change is