Tuesday, October 21, 2008

Improving Sitecore 6 Active Directory Module Performance

There is a new module for Sitecore 6 called Active Directory Module which seems to replace the LDAP Module that was available in Sitecore v5.3 and below. This new module uses the ASP.NET Membership provider available with ASP.NET 2.0. The Official Administrator's guide to this new module explains how to configure it for your Sitecore environment. I will release my unofficial guide in the next day or so but in the meantime you should be aware there are significant performance issues with it that were not present in the old LDAP Module. At least for me and one other person there has been. These steps will explain how to work around these performance issues but aren't supported by Sitecore so be sure to backup all the files I tell you to edit. I haven't seen any problems with this workaround but if you do let me know and I'll investigate, as far as I know these changes do not cause any additional issues. So let's get to it.

When trying to use the User Manager and page through the many users from your AD domain you may notice that it is too slow to use. To improve this you'll want to do a few things:

    Open up the web.config file and find the following line which defines the number of rows returned when paging through the grid which is a Component Art Web UI Grid.

<setting name="GridPageSize" value="15" />

Change the value to 24.

Now open up C:\Inetpub\wwwroot\{websitename}\WebSite\sitecore\shell\Applications\Security\UserManager\UserManager.aspx

Change the PageSize="20" property of the grid to PageSize="24"

Within the columns definitions of the grid comment out the columns for the Domain, Profile.Email, Profile.Comment, Profile.ClientLanguage and Profile.State. This is the change that really improves the performance. You probably don't care about all those fields anyway, and if you do, then just uncomment the one you want to see and it will appear in the grid.

As a side note, the Grid has a property called RunningMode which is set to CallBack, if you set it to Server instead it will cause the Grid to do a post back when paging which I have found did not significantly increase the performance of the paging but if commenting out the lines above doesn't help you may want to try that.

Also within your LDAP query in the AD Module try to get it down to one OU or a few OU's with few people in them, the more data it needs to bring back the worse performance will probably be.

With the changes above, open the User Manager and now instead taking a few minutes to get to the next page or not paging at all, it should only take < 1 min to page to the next set of users. Not great but better than what it was before we started.

The other pain point is managing roles with the Role Manager and managing user roles inside the Role Manager. Comment out the same lines as above in the following files and your performance using Role Manager should also increase.

All files in C:\Inetpub\wwwroot\{websitename}\WebSite\sitecore\shell\Applications\Security\RoleManager include similar Grids except for NewRole.xaml.xml.

And C:\Inetpub\wwwroot\SitecoreSix\WebSite\sitecore\shell\Applications\Security\SelectAccount\SelectAccount.xaml.xml contains a similar grid that you can comment out the Email and Profile.Comment columns.

6 comments:

Anonymous said...

Thanks for the much needed post...I found that this did indeed improve the performance of the dog slow AD module when paging through, or searching for an AD user. Drilling down into the user is another story though. Hopefully, Sitecore will release a patch soon that will make such hacks unnecessary.

Anonymous said...

The new AD module should bring the better performance to you :)
In addition, the additional some trick:
add the ManualPaging="true" to the "<"Grid id="Users" section in \sitecore\shell\Applications\Security\SelectAccount\selectaccount.xaml.xml
It will increase the performance in the Select an account dialog.

Anonymous said...

I am using the new AD module and the performance is still pretty bad with a large number of AD users. The hack above greatly speeds up the response time.

Ryan said...

Thanks for these tips! I think they have helped somewhat, but I believe that our biggest performance bottleneck is in the LDAP query. We are a large organization and will have users across departments accessing sitecore. I am still learning about AD in general, but am thinking it is heierchical which means the common OU we need to pull will return a very large number of records. Do you know if there is a way to constrain the query's results down further besides finding a smaller OU? Thanks in advance!

Rahul said...

Thanks for this great post. I find in ldap.config there are several performance-related settings, especially LDAP.SizeLimit and LDAP.FindSizeLimit.
My AD domains are large with thousands of users, so I set above size limits to very low values (50 and 10 only), but even then, Searching a user in User Manager, and then clicking Edit to edit it, takes very very long, and is pracitcally unusable.
I'd greatly appreciate if any tips how to speed up Search and Edit

electronic signatures said...

EXCELLENT information. Your directions are clear and concise, and easy to follow. Thanks for your hard work in posting this info.