Microsoft Dynamics CRM 2011 Cookbook
上QQ阅读APP看书,第一时间看更新

Optimizing Dynamics CRM 2011 Server performance

In this recipe, we will try to figure out the different performance-boosting techniques we can adopt in the Dynamics CRM 2011 Server environment. Performance tuning is a continuous balancing act between design decision, available resources, hardware, cost, and so on. Additionally, identifying the performance issues in the Dynamics CRM 2011 system is also very important to conduct a tuning.

How to do it…

The following steps explore a few high-level methods of performance tuning:

  1. While considering multiserver deployment of Dynamics CRM 2011, separating the server roles and using network load balancers would significantly improve the performance of the system. In a multiserver deployment, consider deploying the following in dedicated servers:
    • The Dynamics CRM 2011 Front End Server role
    • The Dynamics CRM 2011 Back End Server role
    • The Dynamics CRM 2011 Deployment Server role
    • Dynamics CRM 2011 Database Server
    • Reporting Server for Dynamics CRM 2011
    • Microsoft Dynamics CRM 2011 E-mail Router or Microsoft Exchange Server
    • Active Directory Domain Controller

    Another important consideration of deployment would be federated architecture. If Dynamics CRM 2011 is accessible from different geographies, you should deploy the Dynamics CRM 2011 infrastructure in a federated manner instead of deploying it in a centralized location. The deployment of the Dynamics CRM 2011 servers in the close proximity of the user's access location would assist in reducing the effect of network latency and travel time.

  2. Using HTTP Compression in the IIS7 or any higher versions enables both static and dynamics compression of the Dynamics CRM 2011 web servers in the IIS.

    Perform the following steps to configure HTTP Compression in a web server:

    1. In the Dynamics CRM 2011 web server, go to the Start menu and click on Run, and type inetmgr and press Enter. This will launch the Internet Information Services (IIS) Manager administrative interface.
    2. Double-click on Compression on the Features View tab of the interface.
    3. Click on the Enable dynamic content compression checkbox to enable dynamic compression.
    4. Then, click on the Enable static content compression checkbox to enable static compression.
    Note

    If static compression is enabled, in the Only compress files larger than (in bytes) textbox type the minimum file size that we want IIS to compress.

    Browse to select a cache directory and leave the default value.

    Click on the Per application pool disk space limit (in MB) checkbox and type the maximum amount of space per application pool that IIS uses when it compresses static content.

    Click on the Apply button on the Actions pane to apply these changes.

  3. This step will help you change the MaxConcurrentRequestsPerCPU setting. By default, IIS7.5 (with .NET Framework 4.0) is limited to handling 5000 concurrent requests per CPU and will queue requests above this limit. 5000 is also the value we should use in ASP.NET Versions 2.0 and 3.5, which have a default of 12. Although most web applications usually work fine with the value of 5000, to achieve a better concurrency this value can be altered. This parameter should first be altered and tested for performance in a test environment before moving on to a production system.

    Perform the following steps to modify the MaxConcurrentRequestsPerCPU setting in IIS7.5:

    1. Log in to Windows Server where Microsoft Dynamics CRM 2011 is installed with local machine administrative permission.
    2. Launch Registry Editor by going to the Start menu and clicking on Run. Then type regedit and click on OK.
    3. Navigate to the following location and check whether a DWORD by the name of MaxConcurrentReqeustsPerCPU exists or not.
      • For ASP.NET 4.0:

        HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ASP.NET\4.0.30319.0

      • For ASP.NET 2.0:

        HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ASP.NET\2.0.50727.0

      If the DWORD does not exist, create a new DWORD with the name MaxConcurrentReqeustsPerCPU and specify the value as a higher number.

      If the DWORD already exists, modify the value to a higher number. This is shown in the following screenshot:

  4. Output caching will cache a frequently used object into memory so that it can be delivered quickly on subsequent requests. Add output caching around images files and script files. Perform the following steps to configure output caching:
    1. In the Dynamics CRM 2011 web server, go to the Start menu and click on Run. Type inetmgr and press Enter. This will launch the Internet Information Services (IIS) Manager administrative interface.
    2. Double-click on Output Caching on Features View of IIS.
    3. Then, click on Add in the Actions pane. The Edit Cache Rule page will be launched.
    4. Provide the output caching rule definition by providing the File name extension value, for example, .js.
    5. Select the User-mode caching option.
    6. In the File Cache Monitoring section, select the At time intervals (hh:mm:ss) option and provide a time interval.
    7. Finally, click on the OK button to add the output caching rule as shown in the following screenshot:
  5. Set the Dynamics CRM 2011 Application Pool Recycling interval to an hour or so. Follow the ensuing steps to achieve this:
    1. Launch the Internet Information Services (IIS) Manager interface as a local system administrator.
    2. Click on the Application Pools node in the Object Explorer pane.
    3. Then, right-click on the CRMAppPool node and select Recycling….
    4. The Edit Application Pool Recycling Settings page will appear. Set the Regular time intervals (in minutes) settings to an appropriate time interval, say 60 minutes, and click on Next to proceed.
    5. Click on Finish to save the setting.
  6. To change the timeout values, that is, to add/modify the OLEDBTimeout and ExtendedTimeout registry settings in the web server, follow the ensuing steps:
    1. Go to the Start menu and click on Run, and then type regedit and press Enter.
    2. Navigate to HKEY_LCAL_MACHINE\Software\Microsoft\MSCRM in the registry.
    3. Add a DWORD with the name OLEDBTimeout and a value of 86400, if not already present.
    4. Add another DWORD with the name ExtendedTimeout and a value of 1000000, if not already present.
    Note

    Note that configuring these settings via the web server registry will apply the configuration to all organizations that use the web servers.

  7. Configuring the EnableRetrieveMultipleOptimization (ERMO) setting to the default value of 0 should take place when Update Rollup 10 or higher is installed. Otherwise, Dynamics CRM 2011 will not be able to automatically optimize the performance of the queries against large data sets. With Update Rollup 10, two new statistical settings have been introduced to optimize the RetrieveMultiple queries. These statistical settings are as follows:
    • RecordCountLimitToSwitchToCteSecuritySql (default value of 75000): This specifies the number of records below which Microsoft Dynamics CRM 2011 will default to a query based on the OR operator using joins. We will try to keep this value as high as possible because a lower value will have an impact on SQL Server memory use.
    • RetrieveMultipleSharingCountThreshold (default value of 1000): This specifies the number of shared records that are associated with a user directly or with the teams to which the user belongs. We should consider increasing its value in case a user with an above average number of shared records for any entity is experiencing slow performance with that entity. It is recommended to increase its value in small (100 or 200) increments.

    The value of these two parameters can be modified using the OrgDBOrgSettings tool offered by Microsoft. This tool can be downloaded from http://support.microsoft.com/kb/2691237. There are many more settings that can be modified using this tool. The lists of these settings can be found at the aforementioned link. However, it is advisable to measure the performance benefit as a result of any such modification in a test environment before its application to any live system.

    If these settings do not provide the desired performance, we can consider adjusting the value for the EnableRetrieveMultipleOptimization setting. This specific setting can also be configured with Dynamics CRM 2011 using Update Rollup 2 or higher. Please perform the following steps to configure this setting in the web server:

    1. Go to the Start menu and click on Run, and then type regedit and press Enter.
    2. Navigate to HKEY_LCAL_MACHINE\Software\Microsoft\MSCRM in the registry.
    3. Add a DWORD with the name EnableRetrieveMultipleOptimization and a value of 2, if not already present.
Note

Adding a preferred domain controller setting in the Dynamics CRM 2011 application server will speed up the Active Directory checks. Please follow the ensuing steps to configure this setting in the web server:

Go to the Start menu and click on Run, and then type regedit and press Enter.

Navigate to HKEY_LCAL_MACHINE\Software\Microsoft\MSCRM in the registry.

Add a string value with the name PreferredDC and the value <DC_Name>, if not already present.

How it works…

In this recipe, we have discussed scaling the deployment to improve performance. Thereafter, we have applied IIS-level optimizations offered by IIS7 or higher versions. Though Microsoft Dynamics CRM 2011 is configured to compress web responses that are sent to browser clients by default, HTTP response compression is an IIS-level setting and has to be enabled from IIS. But, compression setting is an IIS-wide setting and cannot be enabled/disabled only for specific websites.

The Dynamics CRM 2011 level settings changes are done to optimize the performance of queries involving large data sets, and the timeout setting is configured so that such queries do not throw timeout errors.

See also

In this chapter, we have discussed various maintenance and optimization recipes. In the next chapter, we will discuss the recipes for administering Dynamics CRM 2011. Some interesting recipes are as follows:

  • Securing Dynamics CRM 2011 deployment with SSL/HTTPS
  • Configuring Internet-facing Deployment
  • Creating a new deployment administrator
  • Creating a Custom Administrator Security role
  • Configuring system-wide settings