Workflow Manager Caching Logic
Workflow Manager
To help reduce the amount of time it takes to search Active Directory, Workflow Manager caches the results of searches for users belonging to a specific role. In this cache, Workflow Manager saves the search results of the CompanyID + RoleID subset that was searched.
This cache gets cleared several times:
• | When the Microsoft IIS Application Pool recycles—This cache is cleared periodically when the web server is idle and the Microsoft IIS Application Pool recycles. In this case, all of the data in the cache is lost. |
• | When the Account page is edited—This cache is cleared each time the Workflow Manager Account page is edited for any account. |
Every time the cache is cleared, there will be a hit in performance for the first user who tries to perform a search while the cache is built again.
Search Settings in web.config
There are two settings in the web.config file that affect caching: LDAPSearchLimit and LDAPSearchPageSize.
Setting |
Decription |
LDAPSearchLimit |
This setting limits how many records are returned from Active Directory. If there is no search filter, Workflow Manager will only get the number of records defined by the LDAPSearchLimit setting (default is 1000). This limit is needed to prevent Workflow Manager from searching the Active Directory of the entire enterprise. The value of this setting can be increased as needed until time outs start to occur. |
LDAPSearchPageSize |
This setting comes into play when there is a search filter given. If the value of this setting is a positive non-zero number, then Workflow Manager ignores the LDAPSearchLimit setting and gets all the users. The value of the LDAPSearchPageSize setting determines the number of records the Active Directory search sends back per search cycle (the number of records that are retrieved each time Workflow Manager queries the Active Directory server). This value does not come into play during normal searches. |
Ignoring the Cache and Searching the All Active Directory Records
The LDAPSearchLimit setting affects the number of records in the cache; Workflow Manager only stores the number of records from a CompanyID + RoleID subset that are found up to the limit defined by this setting.
Therefore, there might be a scenario where the Active Directory user you are trying to find by using a filter search is not being found because that user is not in the stored cache. In this case, you should ignore the cache by prefixing the ~ character to your search string (such as ~Ravi). When ~ is used as a prefix, Workflow Manager ignores the cache and searches Active Directory for the user with that search pattern. After you perform a filter search using the ~ character, those search results are added to the cache (if they were not already in the cache).
The number of records that are returned performing this type of search depends upon the following:
• | If the LDAPSearchPageSize is defined, Workflow Manager tries to return all of the users; there can be timeouts if Active Directory is large. |
• | If the LDAPSearchPageSize setting is zero, then a search will return only the number of records defined by the LDAPSearchLimit setting. |