On Wed, Dec 4, 2024 at 12:33 AM tokers <[email protected]> wrote:
> I noticed (*os.File).ReadFrom has supported splice(2) since go/1.21, and > I'm trying to introduce it to my project. But the performance is not as > expected, which is slower than the normal io.Copy (buffer size = 1MB). Does > anyone who knows the reason? > > For using splice(2), I tweaked the parameters: > > echo 655360 > /proc/sys/fs/pipe-user-pages-soft > That sets the upper limit on how much data a kernel pipe can buffer to 2.5 GiB. That is not reasonable. It is also an upper limit, not the default size. Also, that kernel parameter only existed, AFAIK, in Linux 2.6.34 which was released in 2010. Are you really using a Linux kernel that old? -- Kurtis Rader Caretaker of the exceptional canines Junior and Hank -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/CABx2%3DD--otEg5xv9n_N0z3ButDrvwxa2mO-X07pd%3Da8vTQk4vQ%40mail.gmail.com.
