Regarding Zero write recvfile() performance(splice system call)

Jeremy Allison jra at
Fri Mar 6 10:46:01 MST 2015

On Fri, Mar 06, 2015 at 09:29:43AM -0800, sandeep nag wrote:
> recvfile() is resulting in bad performance, on simultaneous writes, when
> one of the link among the incoming client writes is slower(say a copy from
> WAN). I am using kernel 2.6.18.

Yep. That's expected.

> so,
> 1. Why is splice() performance becoming so bad, when there is a slow link.
> Is this is a known issue in splice() call with 2.6.18 kernel? is there any
> patch to fix this?

splice is known to have very bad performance in Linux in this

The only known patch to fix this I've posted many times on this
list (search for it :-). It's considered too ugly by the Linux kernel developers
to be integrated into the kernel.

> 2. With 'min receivefile size' we can switch between general WRITE path and
> recvfile().But in this case, I would like to switch based on, whether one
> of the incoming client's write link is  slow, how can this be achieved.

You'll have to write custom code for this.

> I want to make it automated, i.e to use normal pwrite path/recvfile path
> based on the configuration.

Custom code is the way to go.

More information about the samba-technical mailing list