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. I was running strace -- here is a small sample: rocess 12270 attached - interrupt to quit select(32, [5 21 31], [], NULL, {59, 890000}) = 1 (in [5], left {59, 330000}) read(5, "\0\0\0H", 4) = 4 read(5, "\377SMB2\0\0\0\0\30\7\310\0\0\0\0\0\0\0\0\0\0\0\0\4\0,"..., 72) = 72 fstat64(34, {st_mode=S_IFREG|0744, st_size=65112414, ...}) = 0 fcntl64(13, F_SETLKW64, {type=F_RDLCK, whence=SEEK_SET, start=24480, len=1}, 0xbff627c4) = 0 fcntl64(13, F_SETLKW64, {type=F_UNLCK, whence=SEEK_SET, start=24480, len=1}, 0xbff627e4) = 0 write(5, "\0\0\0T\377SMB2\0\0\0\0\210A\310\0\0\0\0\0\0\0\0\0\0\0"..., 88) = 88 gettimeofday({1224887351, 92207}, NULL) = 0 select(32, [5 21 31], [], NULL, {60, 0}) = 1 (in [5], left {60, 0}) read(5, "\0\0\200@", 4) = 4 read(5, "\377SMB/\0\0\0\0\30\7\310\0\0\0\0\0\0\0\0\0\0\0\0\4\0\377"..., 32832) = 32832 pwrite64(34, "V\307=\215\22\243\246\315\367\245Yw\303\31\305\6nLz\243"..., 32768, 65112414) = 32768 write(5, "\0\0\0/\377SMB/\0\0\0\0\210\1\310\0\0\0\0\0\0\0\0\0\0\0"..., 51) = 51 gettimeofday({1224887351, 100692}, NULL) = 0 select(32, [5 21 31], [], NULL, {60, 0}) = 2 (in [5 31], left {60, 0}) ioctl(31, FIONREAD, [64]) = 0 read(31, "\1\0\0\0\2\0\0\0\0\0\0\0000\0\0\0ubuntu-8.04.1-de"..., 64) = 64 write(5, "\0\0\0G\377SMB\240\0\0\0\0\210\1\310\0\0\0\0\0\0\0\0\0"..., 75) = 75 gettimeofday({1224887351, 103900}, NULL) = 0 select(32, [5 21 31], [], NULL, {60, 0}) = 1 (in [5], left {60, 0}) read(5, "\0\0\0H", 4) = 4 read(5, "\377SMB2\0\0\0\0\30\7\310\0\0\0\0\0\0\0\0\0\0\0\0\4\0,"..., 72) = 72 fstat64(34, {st_mode=S_IFREG|0744, st_size=65145182, ...}) = 0 fcntl64(13, F_SETLKW64, {type=F_RDLCK, whence=SEEK_SET, start=24480, len=1}, 0xbff627c4) = 0 fcntl64(13, F_SETLKW64, {type=F_UNLCK, whence=SEEK_SET, start=24480, len=1}, 0xbff627e4) = 0 write(5, "\0\0\0T\377SMB2\0\0\0\0\210A\310\0\0\0\0\0\0\0\0\0\0\0"..., 88) = 88 gettimeofday({1224887351, 114838}, NULL) = 0 select(32, [5 21 31], [], NULL, {60, 0}) = 1 (in [5], left {60, 0}) read(5, "\0\0\0T", 4) = 4 read(5, "\377SMB\240\0\0\0\0\30\7\310\0\0\0\0\0\0\0\0\0\0\0\0\4"..., 84) = 84 gettimeofday({1224887351, 119138}, NULL) = 0 select(32, [5 21 31], [], NULL, {60, 0}) = 1 (in [5], left {60, 0}) read(5, "\0\0\200@", 4) = 4 read(5, "\377SMB/\0\0\0\0\30\7\310\0\0\0\0\0\0\0\0\0\0\0\0\4\0\377"..., 32832) = 32832 pwrite64(34, "B\225\371\317\243y\32\216\223\16:\33\n\32\5P!i\230\231"..., 32768, 65145182) = 32768 write(5, "\0\0\0/\377SMB/\0\0\0\0\210\1\310\0\0\0\0\0\0\0\0\0\0\0"..., 51) = 51 gettimeofday({1224887351, 126091}, NULL) = 0 select(32, [5 21 31], [], NULL, {60, 0}) = 1 (in [31], left {60, 0}) ioctl(31, FIONREAD, [64]) = 0 read(31, "\1\0\0\0\2\0\0\0\0\0\0\0000\0\0\0ubuntu-8.04.1-de"..., 64) = 64 write(5, "\0\0\0G\377SMB\240\0\0\0\0\210\1\310\0\0\0\0\0\0\0\0\0"..., 75) = 75 gettimeofday({1224887351, 128913}, NULL) = 0 select(32, [5 21 31], [], NULL, {60, 0}) = 1 (in [5], left {60, 0}) I don't know if that is helpful. Wayne O. Cochran Assistant Professor Computer Science wcochran@vancouver.wsu.edu
Is this a roaming profiles issue? Have you specifically turned off roaming profiles on the XP (Assuming XP here) boxes? Assuming XP, you control roaming profiles on the XP machine, not the Samba Server. On XP: Start, Run, type "gpedit.msc", hit enter. Expand "Computer Configuration" Expand "Administrative Templates" Expand "System" Highlight "User Profiles" Change "Prevent Roaming Profiles from propagating to the server" to enabled. Change "Allow only local profiles" to Enabled. Logout and back in (or reboot.) HTH, Dennis> -----Original Message----- > From: samba-bounces+dmcleod=foranyauto.com@lists.samba.org > [mailto:samba-bounces+dmcleod=foranyauto.com@lists.samba.org] > On Behalf Of Cochran, Wayne Owen > Sent: Friday, October 24, 2008 3:46 PM > To: samba@lists.samba.org > Cc: wcochran@acm.org > Subject: [Samba] more smbd CPU mystery > > 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. > > I was running strace -- here is a small sample: > > rocess 12270 attached - interrupt to quit select(32, [5 21 > 31], [], NULL, {59, 890000}) = 1 (in [5], left {59, 330000}) > read(5, "\0\0\0H", 4) = 4 > read(5, > "\377SMB2\0\0\0\0\30\7\310\0\0\0\0\0\0\0\0\0\0\0\0\4\0,"..., > 72) = 72 fstat64(34, {st_mode=S_IFREG|0744, st_size=65112414, > ...}) = 0 fcntl64(13, F_SETLKW64, {type=F_RDLCK, > whence=SEEK_SET, start=24480, len=1}, 0xbff627c4) = 0 > fcntl64(13, F_SETLKW64, {type=F_UNLCK, whence=SEEK_SET, > start=24480, len=1}, 0xbff627e4) = 0 write(5, > "\0\0\0T\377SMB2\0\0\0\0\210A\310\0\0\0\0\0\0\0\0\0\0\0"..., > 88) = 88 gettimeofday({1224887351, 92207}, NULL) = 0 > select(32, [5 21 31], [], NULL, {60, 0}) = 1 (in [5], left {60, 0}) > read(5, "\0\0\200@", 4) = 4 > read(5, > "\377SMB/\0\0\0\0\30\7\310\0\0\0\0\0\0\0\0\0\0\0\0\4\0\377"... > , 32832) = 32832 pwrite64(34, > "V\307=\215\22\243\246\315\367\245Yw\303\31\305\6nLz\243"..., > 32768, 65112414) = 32768 write(5, > "\0\0\0/\377SMB/\0\0\0\0\210\1\310\0\0\0\0\0\0\0\0\0\0\0"..., > 51) = 51 gettimeofday({1224887351, 100692}, NULL) = 0 > select(32, [5 21 31], [], NULL, {60, 0}) = 2 (in [5 31], left {60, 0}) > ioctl(31, FIONREAD, [64]) = 0 > read(31, > "\1\0\0\0\2\0\0\0\0\0\0\0000\0\0\0ubuntu-8.04.1-de"..., 64) = > 64 write(5, > "\0\0\0G\377SMB\240\0\0\0\0\210\1\310\0\0\0\0\0\0\0\0\0"..., > 75) = 75 gettimeofday({1224887351, 103900}, NULL) = 0 > select(32, [5 21 31], [], NULL, {60, 0}) = 1 (in [5], left {60, 0}) > read(5, "\0\0\0H", 4) = 4 > read(5, > "\377SMB2\0\0\0\0\30\7\310\0\0\0\0\0\0\0\0\0\0\0\0\4\0,"..., > 72) = 72 fstat64(34, {st_mode=S_IFREG|0744, st_size=65145182, > ...}) = 0 fcntl64(13, F_SETLKW64, {type=F_RDLCK, > whence=SEEK_SET, start=24480, len=1}, 0xbff627c4) = 0 > fcntl64(13, F_SETLKW64, {type=F_UNLCK, whence=SEEK_SET, > start=24480, len=1}, 0xbff627e4) = 0 write(5, > "\0\0\0T\377SMB2\0\0\0\0\210A\310\0\0\0\0\0\0\0\0\0\0\0"..., > 88) = 88 gettimeofday({1224887351, 114838}, NULL) = 0 > select(32, [5 21 31], [], NULL, {60, 0}) = 1 (in [5], left {60, 0}) > read(5, "\0\0\0T", 4) = 4 > read(5, > "\377SMB\240\0\0\0\0\30\7\310\0\0\0\0\0\0\0\0\0\0\0\0\4"..., > 84) = 84 gettimeofday({1224887351, 119138}, NULL) = 0 > select(32, [5 21 31], [], NULL, {60, 0}) = 1 (in [5], left {60, 0}) > read(5, "\0\0\200@", 4) = 4 > read(5, > "\377SMB/\0\0\0\0\30\7\310\0\0\0\0\0\0\0\0\0\0\0\0\4\0\377"... > , 32832) = 32832 pwrite64(34, > "B\225\371\317\243y\32\216\223\16:\33\n\32\5P!i\230\231"..., > 32768, 65145182) = 32768 write(5, > "\0\0\0/\377SMB/\0\0\0\0\210\1\310\0\0\0\0\0\0\0\0\0\0\0"..., > 51) = 51 gettimeofday({1224887351, 126091}, NULL) = 0 > select(32, [5 21 31], [], NULL, {60, 0}) = 1 (in [31], left {60, 0}) > ioctl(31, FIONREAD, [64]) = 0 > read(31, > "\1\0\0\0\2\0\0\0\0\0\0\0000\0\0\0ubuntu-8.04.1-de"..., 64) = > 64 write(5, > "\0\0\0G\377SMB\240\0\0\0\0\210\1\310\0\0\0\0\0\0\0\0\0"..., > 75) = 75 gettimeofday({1224887351, 128913}, NULL) = 0 > select(32, [5 21 31], [], NULL, {60, 0}) = 1 (in [5], left {60, 0}) > > I don't know if that is helpful. > > > Wayne O. Cochran > Assistant Professor Computer Science > wcochran@vancouver.wsu.edu > > -- > To unsubscribe from this list go to the following URL and read the > instructions: https://lists.samba.org/mailman/listinfo/samba
Thanks for the incantation -- we will be turning off "roaming profiles." Even so, it still seems that smbd takes *way* too many cpu cycles -- it should be more network and/or disk bound than cpu bound -- at least thats my experience with nfsd. Maybe something is misconfigured with smbd on our system -- I dunno. --thanks, w On Oct 24, 2008, at 4:11 PM, Dennis McLeod wrote:> Is this a roaming profiles issue? > Have you specifically turned off roaming profiles on the XP > (Assuming XP > here) boxes? > > > Assuming XP, you control roaming profiles on the XP machine, not the > Samba Server. > > On XP: > Start, Run, type "gpedit.msc", hit enter. > Expand "Computer Configuration" > Expand "Administrative Templates" > Expand "System" > Highlight "User Profiles" > Change "Prevent Roaming Profiles from propagating to the server" to > enabled. > > > Change "Allow only local profiles" to Enabled. > Logout and back in (or reboot.) >Wayne O. Cochran Clinical Assistant Professor, Computer Science Washington State University Vancouver wcochran@vancouver.wsu.edu http://ezekiel.vancouver.wsu.edu/~wayne
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. Run vmstat to see what is using the CPU. Jeremy.