Samba write throughput

Jacky Lam lamshuyin at gmail.com
Thu Jan 27 19:24:00 MST 2011


On 1/28/2011 9:12 AM, Jeremy Allison wrote:
> On Fri, Jan 28, 2011 at 09:09:20AM +0800, Jacky Lam wrote:
>> On 1/27/2011 2:33 PM, Volker Lendecke wrote:
>>> On Thu, Jan 27, 2011 at 09:24:57AM +0800, Jacky Lam wrote:
>>>> On 1/27/2011 12:38 AM, Jeremy Allison wrote:
>>>>> On Wed, Jan 26, 2011 at 05:51:13PM +0800, Jacky Lam wrote:
>>>>>> Dear all,
>>>>>>
>>>>>>      I setup my Samba server on my machine and get 300Mbps for
>>>>>> reading from server, but only 170Mbps for writing. I found that
>>>>>> reading is use a more efficient way to do with sendfile(). But
>>>>>> writing just use normal file IO and cause too many memory copy. Is
>>>>>> there any way to trigger (from client) or force the server to use
>>>>>> recvfile() instead?
>>>>> http://wiki.samba.org/index.php/Linux_Performance
>>>>>
>>>> Thanks. It is new to me, but it doesn't answer why recvfile/splice
>>>> implementation has not chance to be used when my XP are writing to
>>>> it. Any other idea?
>>> Is your system really so CPU-bound? What kind of CPU do you
>>> have? Atom? ARM? Small MIPS?
>>>
>>> Volker
>>>
>> Yes, my system is seriously CPU-bound. When I copy a file from PC to
>> my MIPS's Samba server, I found that almost 30% CPU time is spending
>> on copy_to_user and copy_from_user. But I googled that although
>> recent Linux does have recvfile(), but Samba has used splice() to
>> reduce the memory copy. That's why I curious.
> In tests I've done with an OEM, using splice() on write makes
> the problem *worse*, unless the kernel has been patched to do
> direct socket to buffer-cache zero copy.
>
> Jeremy.
>
I just checkout the git and see splice is disabled in recent version 
because of Debian's kernel 2.6.28. (By Volker Lendecke) in 
source3/lib/recvfile.c

My kernel is 2.6.29 and I try to turn it on again. I found the problem 
really worse than before. This time all more than 30% CPU time spending 
on solely by copy_to_user.

Jeremy, do you know if the patch you mention exist? Or which kernel 
version are having it already?

Thanks.


More information about the samba-technical mailing list