[Samba] Samba and Dual Core Utilization

Andy Liebman andyliebman at aol.com
Thu Nov 1 00:55:10 GMT 2007


In the past week, working with Samba 3.0.23d and the Linux 2.6.20 
kernel, I have observed something interesting about Samba and the 
utilization of multiple CPU cores.

On a single Dual Core 3 Ghz Xeon machine, when I am hammering the Samba 
server with requests from many client machines, a variety of CPU 
utilization tools like Gkrellm and Qps show that CPU utilization is 
around 30+ percent on one core and only 1 to 2 percent on the other 
core. Qps shows that a single user's smbd process sometimes hops from 
one core to another (which would seem generally undesirable) but all 
smbd processes mostly spend their time on CPU 0.

When I put a second identical CPU on the same motherboard with the same 
kernel, the CPU utilization tools show that smbd processes are evenly 
spread out among all 4 cores. There is a little shifting of smbd 
processes from one core to another, but for most of the time the various 
smbd process each stay on particular cores. CPU utilizaton shows that 
each core is at around 8-12 percent.

Under both scenarios -- one or two physical CPUs -- I am using the same 
VERY BIG RAID subsystem and I am running the same test from the same 
group of workstations. I have replicated my results on multiple 
identical servers so I can't explain the results based on any defect in 
the hardware.

Does anybody have a good explanation as to why smbd seems to more fully 
utilize multiple cores when there are two physical dual core CPUs in the 
system versus when there is just one physical dual core CPU? In theory, 
if CPU utilization is only at 30-40 percent with a single physical CPU, 
is it better to stay on just one core? And would that mean that 
something suboptimal is happening when there are two physical CPUs?

BTW, my kernel is compiled with options "optimized for Core 2/Dual Core 
Xeons" and with SMP support for Dual Core (versus HT).

Good insights would be appreciated.

Andy


More information about the samba mailing list