Samba 4 Slow Performance

David Collier-Brown davec-b at
Wed Jul 31 06:31:21 MDT 2013

On 07/30/2013 10:35 PM, Andrew Bartlett wrote:
> On Wed, 2013-07-31 at 10:07 +0800, Kinglok, Fong wrote:
>> On 29 Jul, 2013, at 1:13 PM, Andrew Bartlett <abartlet at> wrote:
>>> On Sat, 2013-07-27 at 23:20 +0800, Kinglok, Fong wrote:
>>>> Dear all,
>>>> After using samba 3 for two years, I have just spent totally one week
>>>> finishing setting up a samba 4 file system in my working school.
>>>> There are about 200 computers, 80+ staff, 1000 students and 10
>>>> printers.  The AD was properly setup, mandatory profile and one GPO
>>>> policy (which is printer download trust) is effective for all users.
>>>> Logon script is for mapping four shares and 10 printers from the file
>>>> server.   Also, I have setup two additional DCs (with AD replication
>>>> and DHCP server) for two other subnets in the hope to speed up the
>>>> logon process.
>>>> The benefits of Samba 4 are clear: more robust file serving
>>>> (supporting the windows ACL), speedy printing (with the help of point
>>>> and printer driver) and administration of AD through with windows
>>>> remote admin tool.  However, logon speed is just far from good.
>>>> In the days of Samba 3.6, users can logon the system within 20
>>>> seconds, even with more than 80 users logon in the same time (two
>>>> classes students login during computer lesson).  Now, with only one
>>>> user logging in (who is me), it takes nearly 60 seconds to do the
>>>> logon.  I have tried disabling drive and printer mapping in logon
>>>> script and applying a registry hack (note 1) shorten the profile
>>>> waiting time in windows 7 client side but it makes no difference in
>>>> logon speed.
>>>> I have taken a look on the document in sambaXP 2013:
>>>> and two thread in samba-technical mailing list:
>>>> It seems that samba team is doing some great work in spotting the
>>>> unindexed search in LDB as one of block in performance. 
>>> It is one block, but it is the one we expect to really hit at around
>>> 10000, not 1000-2000.  As Richard has indicated, what we need from you
>>> is an indication of what operation is slow.  Timeouts of this order
>>> indicate something different to a slow database - they indicate things
>>> like DNS timeing out. 
>>> Once you work out which specific operation is blocking, we can
>>> investigate more - be it in regards to your network, or our code, we
>>> don't mind either way, but we need to work out which to look into.
>>> Andrew Bartlett
>>> -- 
>>> Andrew Bartlett
>>> Authentication Developer, Samba Team 
>>> Samba Developer, Catalyst IT         
>> Thank you all for responding.
>> In these days, I am trying hard to understand the reason of the delay in logon.
>> Following your advice, I've done some test on
>> 1. Profile deploying
>> 2. GPO
>> For the first one, I try using roaming profile for one testing user, it turns out 7 seconds to logon the system.  It seems that the culprit of the delay is in the my old mandatory profile.
>> For the second one, I try disable all GPO (I only enable point and printer driver trust and folder redirection), turning it on / off does not change the logon time significantly.
>> So, I try digging into how to create mandatory profile properly once again.  Here I found:
>> By following the link's instruction, I found it needs 20 seconds in logon.  I hope I can further decrease the logon time (anyone got a hint?)
>> I will keep updating the list if I found something worth sharing.
> Thanks for getting back to us.  It sounds like this is mostly a
> client-side delay than a Samba issue. 
> Thanks,
> Andrew Bartlett
It might be wise to turn on (or add!) a report of the response time for
the request used to deliver profiles from Samba to the client: if the
problem lies with the client, the response time at the Samba end should
stay roughly the same while the client-side times vary wildly.

--dave (a performance engineer, something you could probably guess from
the comment (:-)) c-b

David Collier-Brown,         | Always do right. This will gratify
System Programmer and Author | some people and astonish the rest
davecb at           |                      -- Mark Twain
(416) 223-8968

More information about the samba-technical mailing list