AD LDS slow on first access - Why?

梦想与她 提交于 2019-12-23 09:27:21

问题


I have an ADLDS instance setup on a local machine (Windows Server 2008 R2 box) for a new application and have knocked up some .Net code to access it. This is one of the functions i'm testing, as you can see its fairly simple stuff.

Dim MyLdapUri As New Uri(searchRoot)

Using MyContext As New PrincipalContext(ContextType.ApplicationDirectory,
                                         MyLdapUri.Authority,
                                         MyLdapUri.LocalPath.Substring(1), ContextOptions.SimpleBind,
                                         strUsername, strPassword)
        Return UserPrincipal.FindByIdentity(MyContext, IdentityType.Name, username)
    End Using

One thing i'm finding happening repeatedly is a ~18s delay on the first time I call this or any other function to access the instance from a test bed application. Subsequent calls made to the AD LDS instance are in the order of 40ms. Once you leave the instance unqueried for a few minutes then calls go back to taking 18s on the first call.

I can't find anything untoward in the event logs. I've also tried connecting to the instance different ways (simple bind to a user defined in the instance as above, using both local and domain Windows accounts) and this 18s additional delay on the first hit always happens. Can anyone give me any pointers to what causes this and/or how I might go about diagnosing/fixing it?


回答1:


This can be due to the way you authenticate to your server.

Is the server on which you install ADLDS in a domain controller?

Is your client computer in the same domain as your server?

How you client computer resolve the DNS part of your URI?

  • In your case you replace LDAP://myserver by LDAP://myserver.ourdomain.local.


来源:https://stackoverflow.com/questions/8790362/ad-lds-slow-on-first-access-why

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!