5

We run a small CentOS server as a test environment with staff connecting to it via Samba shares (from a combination of Macs and PCs).

The smbd service is utilising 5-10% CPU per user - which seems excessive. Especially as the server is a new quad-core.

Mac users seem to be causing higher CPU loads (closer to 10%) and having more problems with connection speed.

Are there any setting or configuration changes that can be made to lower CPU (and hopefully speed up connection for the Macs)

Contents of /etc/samba/smb.conf

# Global Parameters
[global]
        workgroup = Foo
        netbios name = Bar
;       encrypt passwords = yes
        username map = /etc/samba/smbusers
        socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536

[websites]
        path = /var/www/sites
;       browseable = yes
        write list = foobar, barfoo
;       writeable = no
        valid users = foobar, barfoo
BaronGrivet
  • 195
  • 1
  • 6
  • What kind of traffic are you seeing from an OSX host versus a Windows host? – brandeded Oct 07 '11 at 02:10
  • @mbrownnyc - it's anecdotal I'm afraid. We did use the Samba share to copy about 80gig from the Mac -> Samba -> PC and the PC was downloading at about 4 times the speed the Mac was uploading at. – BaronGrivet Oct 07 '11 at 03:06
  • yeah macs dont appear to play very well with windows servers and i dont know why, i thought they may have fixed it in 10.7 (Lion) but the problems persist. random delays on authentication and share list requests... slow performance... ect... – Silverfire Oct 07 '11 at 03:55
  • @Silverfire: I have the opposite anecdote; one or two macs will happily saturate Gigabit ethernet, while most (but not all) windows configs seem hardcoded at 10MB/s ('fast ethernet'?). I don't care much since windows here are for word/excel/email and macs are for big files; still seems weird. Except when I used 3Com switches, as soon as I plugged a mac on one of these, everything dropped to less than 1Mbps. 3Com people insisted that macs were doing "non-standard packets"; of course we haven't bought any 3Com product since. – Javier Oct 07 '11 at 10:40

2 Answers2

1

have you checked the wait time? what does iostat say? If your have a storage bottleneck, it sometimes appear as high CPU usage.

I have a busy fileserver with Samba for 30-50 simultaneous Mac clients (all with Gigabit Ethernet, working with huge Photoshop files) on a modest dual core CPU. The biggest factor was RAM (for cache). Each time the number or workload of users increased, I added some extra RAM, and the CPU usage, as reported from most tools decreased dramatically and responsivity stayed high.

Javier
  • 9,268
  • 2
  • 24
  • 24
  • Hi Javier. Thank you for that. I now have `iostat` installed on our system. Should I try some heavy disc read/ writes while running it? – BaronGrivet Oct 09 '11 at 19:39
  • runt `iostat -x 1` and try whatever it makes it feel sluggish. check if any column changes significantly from the 'quiet' state. especially telling are the await, svctm and %util – Javier Oct 10 '11 at 02:41
0

If there is another Domain Controller, add/edit the following parameters in /etc/smb.conf:

domain master = no
local master = no
preferred master = no
os level = 0

to make Samba never becomes a master browser. Restart Samba to see if it help.

quanta
  • 51,413
  • 19
  • 159
  • 217