smbd: High CPU usage

Jeremy Allison jra at
Thu Jul 19 16:03:42 UTC 2018

On Thu, Jul 19, 2018 at 07:40:27AM +0200, Stefan Metzmacher wrote:
> Am 19.07.2018 um 07:32 schrieb Volker Lendecke via samba-technical:
> > On Wed, Jul 18, 2018 at 04:16:46PM -0700, Jeremy Allison via samba-technical wrote:
> >> On Wed, Jul 18, 2018 at 09:20:10PM +0300, Vadim Lazovskiy via samba-technical wrote:
> >>> I would not agree.
> >>> sendfile is great. It makes you able to serve content directly from disk to
> >>> network without unnessesery copying to userspace. It saves you lots
> >>> syscalls and context switching.
> >>> As for our workload profile (1-2Gbit per server) it really saves CPU time.
> >>>
> >>> If someone of samba developers treat this as bug and eager to fix it I
> >>> could provide extra information and do some debugging.
> >>
> >> Here is a full patchset that should handle all platforms
> >> for which we support sendfile(). Can you try it out and confirm it
> >> fixes your issue ?
> > 
> > I know syscalls are cheap, but don't the additional fcntl ones kill
> > the performance advantage somewhat? We had discussions with a
> > MIPS-based vendor in the past. On that platform (don't remember the
> > exact OS version), syscalls were pretty expensive.
> What about changing to blocking mode only when we actually got EAGAIN?

Yes, I already thought about that - complicates the code changes though.

I wanted to make sure this fixed the problems first.

Now I know it does, I'll re-work the patches to set blocking
on EAGAIN only and re-post.


More information about the samba-technical mailing list