[Samba] Samba 4 slow write

Ervin Hegedüs airween at gmail.com
Thu Apr 16 12:42:48 MDT 2015


Dear Samba users,

here is an Ubuntu 14.04, with Samba 4 (4.1.6), and LDAP (slapd
2.4.31). The config came from a previous system (Debian Squeezy),
which had been crashed (HW error - on this new machine, I've put
Ubuntu).

So, as I wrote, the smb.conf and LDAP database was copied from
the backup from the old system - but it works as well. Only one
thing what's very annoying. The Samba is "only" a fileserver, not
AD. Users put all files to Samba, eg. small projects for
microcontrollers, written in C. Most user compiles the project on
the Samba shares. The clients are Windows 7 and 8.

These processes on the previous system takes about 8-10 seconds
(of course, this is a very relative time...). On this new system,
this compile process for some users takes still 8 seconds, but
for some users takes 80-100 seconds. The different between the
two groups is the "fast" group members are listed after the
"admin users" in the smb.conf, the "slow" users aren't.

Note, that there are some users, who listed in admin users AND
member of Domain Admin's and Administrators group in system, but
there are anothers, who're only listed in smb.conf.

This setting indicates that the compile time is very short.

Here are the output of "strace -c -f -o PID_OF_SMBD_OF_USER":
first is when the user is listed after the admin users, second if
not.

% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 30.66    2.544068           6    408122           fcntl
 11.15    0.925249           5    178565           getegid
  8.58    0.712096          16     44168           poll
  8.09    0.671191          15     43904        25 writev
  6.99    0.579632           7     87637           readv
  6.74    0.558894           6     89031           setresgid
  5.75    0.476910           5     90258           geteuid
  5.17    0.428692           7     64342       138 lstat
  3.42    0.283836           6     44877           setgroups
  3.25    0.269644           6     44877           setresuid
  2.54    0.211059           9     24111         5 stat
  2.34    0.194014          10     19129           open
  1.71    0.141637           7     19139           close
  1.61    0.133204           6     23576           fstat
  1.34    0.111502           6     19307           getcwd
  0.23    0.019376          61       317           pread
  0.09    0.007880           7      1115           newfstatat
  0.08    0.006739          15       438           pwrite
  0.05    0.004449           8       567           read
  0.05    0.003875           5       794           getgroups
  0.04    0.003103          19       163           write
  0.02    0.001770           5       326           alarm
  0.02    0.001605           5       326           rt_sigaction
  0.02    0.001588          16       102           brk
  0.02    0.001494          18        85           getdents
  0.02    0.001441           5       265       181 flock
  0.00    0.000362          11        33           getxattr
  0.00    0.000279          25        11           utimensat
  0.00    0.000212           9        23           chdir
  0.00    0.000122         122         1           unlink
  0.00    0.000110          14         8           connect
  0.00    0.000095          16         6           setxattr
  0.00    0.000074           9         8           socket
  0.00    0.000064           8         8           sendto
  0.00    0.000061           7         9           ioctl
  0.00    0.000052          52         1           restart_syscall
  0.00    0.000049          25         2           fsetxattr
  0.00    0.000044          11         4           inotify_add_watch
  0.00    0.000020          10         2           openat
  0.00    0.000018          18         1           fchown
  0.00    0.000007           7         1           statfs
  0.00    0.000006           6         1           getpeername
------ ----------- ----------- --------- --------- ----------------
100.00    8.296523               1205660       349 total

-%-
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 15.68   15.894980           4   4398791           getegid
 15.57   15.783699           4   4398801           geteuid
 10.97   11.121083           5   2436120           fcntl
  8.08    8.190890           4   1833257           setresuid
  7.71    7.818681           4   1833257           setresgid
  7.47    7.573659           6   1240557           read
  6.62    6.710420           5   1464681           setgroups
  6.00    6.086350           9    653966           poll
  5.58    5.658247          15    368339           write
  3.98    4.037676           4   1100746           getgroups
  3.51    3.560919           9    413422    368308 lstat
  3.18    3.222918           4    736678           alarm
  2.85    2.894501           4    736678           rt_sigaction
  0.97    0.988530           5    209794         8 stat
  0.62    0.626750           7     87787      9486 getxattr
  0.41    0.412485          12     33776        24 writev
  0.37    0.376310           6     67120           readv
  0.13    0.136265          10     13935           open
  0.09    0.089888           6     13944           close
  0.08    0.082553           4     18598           fstat
  0.06    0.062117           4     14055           getcwd
  0.04    0.037146           5      7605           newfstatat
  0.01    0.010147          32       317           pread
  0.01    0.007293          16       453           pwrite
  0.01    0.007012          14       488           getdents
  0.00    0.003897          15       262           brk
  0.00    0.000858           4       216       132 flock
  0.00    0.000494           6        82           chdir
  0.00    0.000325          17        19         9 utimensat
  0.00    0.000247          62         4           fdatasync
  0.00    0.000235           5        51           getpeername
  0.00    0.000155           7        21           ioctl
  0.00    0.000139         139         1           unlink
  0.00    0.000122          31         4           msync
  0.00    0.000117           9        13           inotify_add_watch
  0.00    0.000080          10         8           connect
  0.00    0.000069          12         6           munmap
  0.00    0.000056           7         8           socket
  0.00    0.000053           9         6           mmap
  0.00    0.000052           7         8           sendto
  0.00    0.000046           9         5           inotify_rm_watch
  0.00    0.000045           8         6         5 setxattr
  0.00    0.000038          19         2           fsetxattr
  0.00    0.000033          17         2           utime
  0.00    0.000028           6         5         5 chmod
  0.00    0.000023           4         6           umask
  0.00    0.000019          19         1           restart_syscall
  0.00    0.000017           6         3           dup2
  0.00    0.000015           8         2           openat
  0.00    0.000014          14         1           fchown
  0.00    0.000009           9         1           statfs
  0.00    0.000008           8         1           ftruncate
------ ----------- ----------- --------- --------- ----------------
100.00  101.397713              22083909    377977 total

After I described this, I've put these two lines to smb.conf:

   ldapsam:trusted = yes
   ldapsam:editposix = yes

Then the compile time for non-admin users gone to 30 seconds.

Note, that the compile time for admin users was about 8 seconds
throught the tests.

But at last weekend, there was a system restart - after the
restart, the users notified me, nobody can access to any share.
I've checked with my account, and I got this (with smbclient):

session setup failed: NT_STATUS_INTERNAL_DB_CORRUPTION

I've removed these two lines, and users could access again the
shares. Now Samba works without these two lines, but the compile
process is too slow again...



Could anybody explain, what can be wrong in this Samba?


Many thanks,


Ervin




-- 
I � UTF-8


More information about the samba mailing list