Storefront 2.5 and above offers support for Parallel Resource Enumeration. When enabled, StoreFront sends out enumeration requests to all XML brokers from different farms at the same time, and aggregates responses when those have responded. This comes really useful when your Storefront servers aggregates resources from several farms at same time. The whole idéa behind this is to provide faster responses to user queries when aggregating multiple farms. The parallel resource enumeration process activates by default when 3 or more farms/sites are being aggregated (this can be modified of course). There are ways to turn this feature on or off if you wish.

Before you can do that, you need to import the necessary PowerShell modules by alternatively navigating to scripts folder on Storefront server, and enter the following using powershell as administrator:

cd “C:\Program Files\Citrix\Receiver StoreFront\Scripts”
. .\ImportModules.ps1

Turn off parallel resource enumeration by using the  Set-EnhancedEnumerationOff syntax:

Set-EnhancedEnumerationOff [[-storeVirtualPath] <Object>] `
[[-siteId] <Object>]

where storeVirtualPath is the virtual path for the store (Exampel: /Citrix/Store) and siteId is the IIS WebSite ID for the store (typically 1).
Full exampel: Set-EnhancedEnumerationOff “/Citrix/Store”

If you accidently did turn off “parallel resource enumeration”, and need to reset it to default behaviour, type the following:

Reset-EnhancedEnumerationOptions [[-storeVirtualPath] <Object>] `
[[-siteId] <Object>]

where storeVirtualPath is the virtual path for the store (Exampel: /Citrix/Store) and siteId is the IIS WebSite ID for the store (typically 1).
Full exampel: Reset-EnhancedEnumerationOptions “/Citrix/Store”

Now Let’s imagine a scenario when we have up to 30 farms to enumerate resources from at same time. This means our Storefront servers will send out enumeration requests to 30 farms through their XML brokers at same time. You may wonder how to tweak the different parameters available in Store “web.config” file, for best respons possible in such case.

Well, Logon to your Storefront server and open “web.config” file as administrator
(Located here: C:\inetpub\wwwroot\Citrix\Store), and you may see something like this:

<farmset name=”Default” enableFileTypeAssociation=”on” pooledSockets=”off”
serverCommunicationAttempts=”1″ communicationTimeout=”20″ connectionTimeout=”6″
multiFarmAuthenticationMode=”ANY”>

and

<enumeration enhancedEnumeration=”on” enhancedEnumerationAuthenticator=”defaultDelegatedAuthenticator” maxConcurrentEnumerations=”0″ minFarmsForConcurrentEnumeration=”3″ treatDesktopsAsApps=”off” requestFullIconData=”full-and-multi”>
<requestedHighColorIcons>

In this case you may want to adjust the communicationTimeout value depending on how fast or slow connections to your backend farms are. If the connections to those farms are fast enough, you may want to tweak this value down to 10. In case the connections to the farms are slow, then increase the value accordingly.

Changing the “serverCommunicationAttempts” to 1 will make Storefront fails the failure farm much faster so that it reduces the impact on the overall client response time.

Be careful here! Citrix have a bug in SocketPooling enabled with parallel enumeration that might appear when they are enabled together. So it is better to turn it off for proper functionality of parallel enumeration. Hopefully this will be fixed in future releases of Storefront.

Make sure to change the value of minFarmsForConcurrentEnumeration to 2 to tell Storefront to kick in Parallel Resource Enumeration when two farms or more are available as delivery controllers on Storefront configuration.

In case, your users are using Receiver For Web as well, you should also think about increasing the timeout value for communications between Receiver For Web and the Store Service.
To do this you need to locate the following line <communication attempts=”2″ timeout=”00:01:00″> from web.config file under the Receiver For Web site.
Typically located here:  C:\inetpub\wwwroot\Citrix\StoreWeb

<communication attempts=”2″ timeout=”00:01:00″>
Increase the timeout value from 1 minute to 2 minutes:
<communication attempts=”2″ timeout=”00:02:00″>

This would make Receiver For Web waits longer before it declares that it is timed out. This can be increased further slightly if necessary, but not too much as browsers may not wait for that long.

When you are done, you may end up with the following as example when you have 30 delivery controllers in place on Storefront:

serverCommunicationAttempts=”1″ communicationTimeout=”10″
Pooled socket “off” ,enhancedEnumeration=”on” maxConcurrentEnumerations=”30″ minFarmsForConcurrentEnumeration=”2″