Dale Renton
2017-Nov-17 14:46 UTC
[Samba] High CPU While Loading RSAT Active Directory Users and Computers
Hello, I'm trying to figure out a problem with our AD DC with the FSMO roles, name DC1. When starting the Windows RSAT Active Directory Users and Computers program against DC1 it takes about 90 seconds to load. A samba process on the server is at 100% CPU while waiting for it to load. Once loaded the CPU goes back to normal. When connecting the Active Directory Users and Computers program against DC2 though it loads in a couple of seconds. DC1 and DC2 are on two different identical physical servers with the same config. When running strace on the 100% CPU process, most of the time is spent on the fcntl syscall. CentOS 7 Samba 4.5.10 samba-tool dbcheck returns 0 errors samba-tool dbcheck --cross-ncs returns 0 errors samba-tool drs showrepl returns 0 failures smb.conf : [global] netbios name = DC1 realm = AD.EXAMPLE.COM server services = s3fs, rpc, nbt, wrepl, ldap, cldap, kdc, drepl, winbindd, ntp_signd, kcc, dnsupdate workgroup = EXAMPLEAD server role = active directory domain controller idmap_ldb:use rfc2307 = yes # used for OpenLDAP sync password hash gpg key ids = ........... # temporary ntlm auth = yes [netlogon] path = /usr/local/samba/var/locks/sysvol/ad.example.com/scripts read only = No [sysvol] path = /usr/local/samba/var/locks/sysvol read only = No root preexec = /usr/local/samba/var/locks/sysvol/ ad.example.com/scripts/logonscript.py %U %I %a strace -c -p 2053 returns : strace: Process 2053 attached strace: Process 2053 detached % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- 96.49 0.169676 0 964777 13 fcntl 1.74 0.003061 10 305 epoll_wait 0.74 0.001302 0 10672 read ............ strace -p2053 returns hundreds of thousands of lines like this : fcntl(12, F_SETLKW, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=1652100, l_len=1}) = 0 fcntl(12, F_SETLKW, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=11368, l_len=1}) = 0 fcntl(12, F_SETLKW, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=11368, l_len=1}) = 0 fcntl(12, F_SETLKW, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=1652100, l_len=1}) = 0 fcntl(12, F_SETLKW, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=11368, l_len=1}) = 0 fcntl(12, F_SETLKW, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=11372, l_len=1}) = 0 fcntl(12, F_SETLKW, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=17976160, l_len=1}) = 0 fcntl(12, F_SETLKW, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=11372, l_len=1}) = 0 fcntl(12, F_SETLKW, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=11372, l_len=1}) = 0 fcntl(12, F_SETLKW, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=17976160, l_len=1}) = 0 fcntl(12, F_SETLKW, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=2147760, l_len=1}) = 0 fcntl(12, F_SETLKW, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=11372, l_len=1}) = 0 ................ Any thoughts ? Thanks, Dale
Andrew Bartlett
2017-Nov-17 21:29 UTC
[Samba] High CPU While Loading RSAT Active Directory Users and Computers
On Fri, 2017-11-17 at 10:46 -0400, Dale Renton via samba wrote:> Hello, > > I'm trying to figure out a problem with our AD DC with the FSMO roles, name > DC1. When starting the Windows RSAT Active Directory Users and Computers > program against DC1 it takes about 90 seconds to load. A samba process on > the server is at 100% CPU while waiting for it to load. Once loaded the > CPU goes back to normal. When connecting the Active Directory Users and > Computers program against DC2 though it loads in a couple of seconds. DC1 > and DC2 are on two different identical physical servers with the same > config. When running strace on the 100% CPU process, most of the time is > spent on the fcntl syscall.> CentOS 7 > Samba 4.5.10 >I can't explain the difference but we did a lot of work for Samba 4.7 to address this issue, which is due to a locking bug. Andrew Bartlett -- Andrew Bartlett http://samba.org/~abartlet/ Authentication Developer, Samba Team http://samba.org Samba Developer, Catalyst IT http://catalyst.net.nz/services/samba