-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
[BanyanDB-Server] Using "bufio" to Improve the Write #12447
Comments
Please assign to me. |
@sollhui Have you talked with @hanahmily to make sure you are working on the correct road? |
@wu-sheng Not yet, but I think it is a easy work. |
Talk with him. I don't think that easy. And if you don't know SkyWalking and BanyanDB that much, you are hard to test and verify. |
I had contribute this pr apache/skywalking-banyandb#341 to build local system, and I think the work of this issue is aim to replace the code
by
So I think it is a easy work. @hanahmily, @wu-sheng please check it. |
OK, as 341 was on you, I think it is good. |
@sollhui The key point is determining the optimal buffer size. I want to avoid requiring users to set it manually. Can you come up with a way to automatically retrieve this value based on the system's available memory? Please share the specifics here once you have some ideas. |
@hanahmily Before discussing this issue, I have another point I would like to discuss. Why not batch in memory instead of using bufio? Some of the drawbacks I can think of are that there is still a memory copy from memory to bufio, which is unnecessary. Isn't it better to directly save to a certain byte in memory like 200MB and flush it down? |
It's reasonable but too difficult to implement. The entire design needs to be re-evaluated, but that's not the goal of this issue. Let's solve this issue based on the current design. After you finish this, if you are interested in this matter, please review the code and then propose a reasonable design for it. |
@hanahmily I have some ideas for this design:
|
That's a good idea. We have a metric to track the available memory on the node. You can make use of it.
Exactly, we should get the default value through such a benchmark.
The maximum buffer size should be specified as a quantity rather than a ratio. Based on my experience, a buffer size of 4KB to 1MB is a reasonable range. |
Search before asking
Description
In the file system module, the write operation flushes the data directly to the OS. It is recommended to use "bufio" to reduce the write operation frequency and improve performance.
Use case
No response
Related issues
No response
Are you willing to submit a pull request to implement this on your own?
Code of Conduct
The text was updated successfully, but these errors were encountered: