[Samba] more smbd CPU mystery

Cochran, Wayne Owen wcochran at vancouver.wsu.edu
Sat Oct 25 15:58:17 GMT 2008



-----Original Message-----
From: Jeremy Allison [mailto:jra at samba.org]
Sent: Fri 10/24/2008 9:14 PM
To: Cochran, Wayne Owen
Cc: samba at lists.samba.org; wcochran at acm.org
Subject: Re: [Samba] more smbd CPU mystery
 
On Fri, Oct 24, 2008 at 03:46:04PM -0700, Cochran, Wayne Owen wrote:
>> Well I have determined that everytime someone logs in/logs out
>> of a windows box in our lab *ALL* of the files in "My Directory"
>> are copied from/to the file server to the local client. Needless to
>> say this is retarded and needs to stop. The local sys admin needs
>> to perform some windows voodoo to redirect this directory.
>> 
>> Still this brings the mystery as to why smbd would take up so
>> much CPU. The work should mainly network and disk i/o bound
>> (not CPU bound).  nfsd doesn't have this kind of bad CPU performance,
>> why does smbd?
>> 
>> I had one of the users download a big file (which was being saved
>> on the desktop). During this I was running top on the file server
>> and noted it was continually soaking up 25% of the CPU:
>> 
>>   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND      
>> 12270 liffland  20   0 12748 4776 3628 S   24  0.1   1:02.36 smbd             
>> 
>> Why would disk/network traffic be so CPU heavy? Shouldn't this mostly
>> be handled by a DMA controller?  Can anyone explain this.

>You need to split out the CPU usage into user/kernel numbers.
>Yes, smbd is using a lot of CPU here but if it's mostly in
>kernel then it's just doing it's job. You *want* smbd to
>be cpu bound, it's really easy to increase CPU by adding
>more CPU than it is to increase network bandwidth
>or disk i/o - that gets expensive.

Yeah I assume mot of the heavy lifting is in kernel space.
But even so I thought that most of the work involves
"data movement" -- most which could be handled via
a DMA controller without the CPU being involved.
Of course I don't have a deep working knowledge
of what's going on like you do.

>Run vmstat to see what is using the CPU.

I'll give that a spin.

Now I am trying to query what the current "log level" 
or "debug level" is. Perhaps the admin has this set
really high -- there are over 220 files in /var/log/samba
-- most of which seem to be updated frequently:
I also note there is some data being logged in files
under /etc/samba as well. I don't see the log level
specified in the smbd.conf nor in the start up script 
that starts smbd. smbstatus and smbcontrol only seem
to allow me to *set* (not *query*) the current log level.
How can I query this?

Thanks for all your help. 
 
--w
 



More information about the samba mailing list