-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix(cache): make updating the max cost of posting cache work again #9526
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
Conversation
ac00282 to
9e1fba4
Compare
9e1fba4 to
7a51a94
Compare
|
Oh wow, good catch. So the Edit: I see now that it was max cost that was not getting updated, not the other configs. |
|
My app has a mode where it can do a full linear scan of all nodes to check consistency etc. I've notice that even with this change, if I set posting cache to anything greater than 0, my alphas mem usage goes from a steady 1-2G to 10G (container limit) and then restarts. My cache is set to 4G so I beleive there is one more issue hiding here preventing the cache to be sized appropriately? |
|
@matthewmcneely Yep im running direct from main, hash 68c24d5. This isnt an immediate problem for me as i run with the posting cache off currently, but just a heads up that I think theres another leak in there somewhere in this cache. The code that triggers it runs through all nodes of a type in ascending uid order, in batches of 250. The uid batches are passed to another routine that fetches all predicates for this uid, returning the complete node . |
Right, but as you probably know the posting cache is only part of the memory that Dgraph allocates. I've ran tests that show the fix in #9515 is making things better from that perspective. But it would be good to understand your "full linear scan" details. Maybe open up a new topic thread in our new, spiffy Discussions? |
|
@RJKeevil Can you collect and share a heap profile of an alpha node when it has high memory consumption? Below an example request for that. curl http://<alpha_host>:8080/debug/pprof/heap > heap.outPlease also post the output of the command below. dgraph versionAlso, memory calculation on Linux is not straightforward, your container runtime might determine used memory different from other tools. I suggest you experiment with different cache sizes, for example |
|
for future reference discussion moved to here and solved https://github.com/orgs/dgraph-io/discussions/9535 |
Updating the max cost of the posting list cache is not wired up. It just calls an empty function. This PR adds a method to
MemoryLayer, that allows updating the max cost of its cache. The old function is deleted and the function call is replaced with a call to the new method.