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
internal/poll: provide method to change maxSpliceSize #40222
Comments
CC @acln0 If 32K is better than 4M on your system, perhaps we should just use that everywhere. |
Seconded @ianlancetaylor if there is a better value, let's make it the default rather than a configuration option. |
In principle, I don't see why not, but I would need to run benchmarks to make sure that the change doesn't represent a regression for code that transfers a huge volume of data per unit of time through splice (the kind of systems that saturate links). Such code was the motivation for introducing the splice code in the first place, and a regression would be undesirable. If there is a singular better value, then, of course, that should be the default. Trying to sneak configuration down to the splice code seems to be prohibitively difficult to me anyway, so I think that option is off the table. I do wonder why a maximum transfer size of 4M per splice round makes things significantly slower, though. We also have a large round size here:
Should we change this one too? Or is this one different because it's copy_file_range and not splice? Even if we changed the 4M to 32K today, the change wouldn't make it into the 1.15 tree, so I think it would be better to investigate it properly, by reading kernel source code, running more benchmarks, and so forth. I am going to do that at some point in the 1.16 development cycle. @march1993 But while you are at it, and have patched your tree already, can you try a few additional intermediate transfer sizes and report the performance you observe, please? Perhaps 64K, 256K, and 1M? Thanks. |
The length should be under MAX_RW_COUNT which based on PAGE_MASK I can send a CL for this and done some tests on my rpi etc. |
Change https://go.dev/cl/425051 mentions this issue: |
@march1993 What is the contents of the file |
It was |
Were you transferring a mass of data via |
A mass of data. The kernel version was |
go/src/internal/poll/splice_linux.go
Line 20 in c5d7f2f
I suffer from poor performance caused by the default maxSpliceSize 4MiB on my embedded platforms. Would it be beneficial that a method is provided to change it?
After I changed the value from 4MiB to 32KiB on my OpenWRT router, I got a twice performance.
The text was updated successfully, but these errors were encountered: