-
Notifications
You must be signed in to change notification settings - Fork 467
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
Memory limits on connections #2284
Comments
I am interested in this problem. Could you assign the issue to me? |
@AntiTopQuark Sure, go for it! |
Hello @AntiTopQuark, I am also interested in this issue. When I implemented the Sort command before, there was a need for memory restrictions.
It seems that the current memory statistics of kvrocks are still coarse-grained process-level statistics. Do we need more fine-grained tracking statistics? They seem to utilize the memory allocator to achieve this, would you like to share and discuss your thoughts? |
I briefly read through the three articles and found that most methods are quite similar. They all involve tracking the type, size, and frequency of allocations, as well as the stack at the time of allocation, to avoid OOM errors and to diagnose memory leaks. I am more familiar with the OceanBase database, which mainly implements a series of ObAllocator's OceanBase Official Documentation For the issue with kvrocks, I think it’s best to keep it simple. Implementing overrides for malloc and new to record the number of allocations and the amount of memory should suffice. Additionally, you can limit memory allocation using the max-memory configuration item and set a limit on the maximum number of connections. |
I prefer a simpler approach, count the size of the output buffer each time you put something into it. Of course, it's better to use a memory allocator. |
Search before asking
Motivation
The lack of memory constraints in current Kvrocks can lead to OOM, especially when deployed in container environments.
Solution
We should provide mechanisms to limit memory and avoid OOM.
In the connection dimension:
WriteBatch
client-output-buffer-limit
andmaxmemory-clients
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: