[Samba] Smbd using too much CPU

Kim Lindberg kim at syndromedia.se
Mon Apr 17 10:46:04 GMT 2006


I recently got the problem that my smbd process takes up a lot of CPU (about
60%). It's running this high even if I don't access the server through my
samba clients. I have tried restarting samba, rebooting the computer and I
have been looking at several logs but I can't see what's wrong. It never
seems to relax. I need to fix this as fast as possible because my CPU fan is
running so high I can't even think.

 

This is an extract from top:

----------------------------------------------------------------------------
--------------------------------

[root at localhost /]# top

PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND

13320 root      16   0  190m 181m 2400 R 77.2 36.1  43:36.14 smbd

 

 

 

This is the result from running strace for about five seconds:

----------------------------------------------------------------------------
--------------------------------

 

 [root at localhost /]# strace -p 13320 -cfqrT

% time     seconds  usecs/call     calls    errors syscall

------ ----------- ----------- --------- --------- ----------------

 75.61    0.085973           6     13814      1740 stat64

  9.71    0.011036           7      1560           select

  5.66    0.006436           4      1561           write

  4.30    0.004889           6       847           open

  1.93    0.002193           1      1774           getdents64

  1.52    0.001728           1      3120           read

  1.10    0.001249           1      2231           fcntl64

  0.09    0.000107           0       847           close

  0.09    0.000098           0       847           fstat64

  0.00    0.000000           0         8           time

  0.00    0.000000           0         6           lseek

  0.00    0.000000           0      1560           gettimeofday

  0.00    0.000000           0        25           mremap

------ ----------- ----------- --------- --------- ----------------

100.00    0.113709                 28200      1740 total

 

 

 

 

Here's an extract from strace -p 13320 -f. I don't understand anything from
it.

----------------------------------------------------------------------------
--------------------------------

gettimeofday({1145270319, 463254}, NULL) = 0

stat64("proc/self/task/13320/cwd/proc/self/task/13320/cwd/proc/self/task/133
20/cwd/proc/self/task/13320/cwd/proc/self/task/13320/cwd/proc/self/task/1332
0/cwd/proc/self/task/13320/cwd/proc/self/task/13320/cwd/proc/2/root/proc/6/c
wd/proc/13123/fd", {st_mode=S_IFDIR|0500, st_size=0, ...}) = 0

fcntl64(13, F_SETLKW64, {type=F_WRLCK, whence=SEEK_SET, start=672, len=1},
0xbfec6344) = 0

fcntl64(13, F_SETLKW64, {type=F_UNLCK, whence=SEEK_SET, start=672, len=1},
0xbfec6284) = 0

write(23, "\0\0\0d\377SMB2\0\0\0\0\210A\310\0\0\0\0\0\0\0\0\0\0\0"..., 104)
= 104

select(24, [5 23], NULL, NULL, {60, 0}) = 1 (in [23], left {60, 0})

read(23, "\0\0\0020", 4)                = 4

read(23, "\377SMB2\0\0\0\0\30\7\310\0\0\0\0\0\0\0\0\0\0\0\0\2\0\204"...,
560) = 560

gettimeofday({1145270319, 495271}, NULL) = 0

stat64("proc/self/task/13320/cwd/proc/self/task/13320/cwd/proc/self/task/133
20/cwd/proc/self/task/13320/cwd/proc/self/task/13320/cwd/proc/self/task/1332
0/cwd/proc/self/task/13320/cwd/proc/self/task/13320/cwd/proc/2/root/proc/6/c
wd/proc/13123/fd", {st_mode=S_IFDIR|0500, st_size=0, ...}) = 0

stat64("proc/self/task/13320/cwd/proc/self/task/13320/cwd/proc/self/task/133
20/cwd/proc/self/task/13320/cwd/proc/self/task/13320/cwd/proc/self/task/1332
0/cwd/proc/self/task/13320/cwd/proc/self/task/13320/cwd/proc/2/root/proc/6/c
wd/proc/13123/fd/*", 0xbfec57d0) = -1 ENOENT (No such file or directory)

stat64("proc/self/task/13320/cwd/proc/self/task/13320/cwd/proc/self/task/133
20/cwd/proc/self/task/13320/cwd/proc/self/task/13320/cwd/proc/self/task/1332
0/cwd/proc/self/task/13320/cwd/proc/self/task/13320/cwd/proc/2/root/proc/6/c
wd/proc/13123/fd/*", 0xbfec57d0) = -1 ENOENT (No such file or directory)

open("proc/self/task/13320/cwd/proc/self/task/13320/cwd/proc/self/task/13320
/cwd/proc/self/task/13320/cwd/proc/self/task/13320/cwd/proc/self/task/13320/
cwd/proc/self/task/13320/cwd/proc/self/task/13320/cwd/proc/2/root/proc/6/cwd
/proc/13123/fd", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 24

fstat64(24, {st_mode=S_IFDIR|0500, st_size=0, ...}) = 0

fcntl64(24, F_SETFD, FD_CLOEXEC)        = 0

stat64("proc/self/task/13320/cwd/proc/self/task/13320/cwd/proc/self/task/133
20/cwd/proc/self/task/13320/cwd/proc/self/task/13320/cwd/proc/self/task/1332
0/cwd/proc/self/task/13320/cwd/proc/self/task/13320/cwd/proc/2/root/proc/6/c
wd/proc/13123/fd/.", {st_mode=S_IFDIR|0500, st_size=0, ...}) = 0

 

 

 

The samba logs doesn't tell me anything and neither does /var/log/messages.
What is going on?

 

The computer is a ~2GHz Intel, 512MB ram, Fedora Core 5.

 

 

Kim Lindberg

 



More information about the samba mailing list