Thursday, January 24, 2013

How to improve CRMAsyncService.exe memory and CPU usage.


The Microsoft CRM web site if hosted on a multi-processor/core server will automatically be using server Garbage Collection mode, but for managed Microsoft .Net programs like the CRMAsyncService.exe, they will default to the workstation garbage collection mode. Note that this resolution will only apply if Microsoft Dynamics CRM is installed on a multi-processor or multi-core server since the crmasyncservice will aways be forced to use the Microsoft .Net workstation garbage collection mode on a single CPU (non multi-core) server.

In order to allow the CRMAsyncService.exe to take advantage of all the processors/cores on a server, you can add the following element to a CRMAsyncService.exe.config file and place it in the same directory as the CRMAsyncService.exe program, typically in the “C:\Program Files\Microsoft Dynamics CRM\Server\bin” directory if you haven’t changed the default installation location for the Microsoft CRM Server.

Note that these changes will take effect the next time that you restart the Microsoft CRM Async Service.  Also note that if you already have a crmasyncservice.exe.config file, to place this information for the <gcServer enabled=”true”/> into the Runtime and configuration tags as seen below.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
   <runtime>
      <gcServer enabled="true"/>
   </runtime>
</configuration>

As with any changes, although this can give much better throughput for the Microsoft CRM Async Service and workflows able to be executed in a given time frame, it is best to measure the changes before and after implementing this change.  The CRM Async Service perfmon counters can be used for this as well as counters for Memory, .Net CLR Memory, and Processor.  There are also other factors such as customizations, workflows, and SQL Server performance that plays a factor in overall Microsoft CRM Async Service performance, but enabling gcServer mode is a great way to improve performance on multi-processor servers with minimal effort.

Friday, October 19, 2012

Microsoft CRM 2011 Solution backups with help of Plugins.

     This small plugin can save a lot of time and put things under control. Each time somebody press on Publish All button, it creates a backup of all user solutions (system solution is ignored) and creates a task in the system with attached backups. So you can easily find a right task with right backups of solutions.

Wednesday, August 29, 2012

Optimizing Microsoft .NET ThreadPool Settings for Microsoft CRM 2011

    You can modify parameters in the Machine.config file to accommodate a specific environment. However, if each .aspx page makes a Web service call to a single IP address, it is recommended to adjust these parameters as shown in the following table:

Thursday, March 22, 2012

Some useful functions for MS CRM 2011 Reports


Here is a couple of useful functions for MS CRM 2011 reports:


Function that used to remove the duplicate records
Public Shared Function RemoveDups(ByVal items As String) As String
         Dim noDups As New System.Collections.ArrayList()
        
         Dim SpStr
         SpStr = Split(items ,",")

         For i As Integer=0 To Ubound(Spstr)
                   If Not noDups.Contains(SpStr(i).Trim()) Then
                            noDups.Add(SpStr(i).Trim())                       
                   End If
         Next

         Dim uniqueItems As String() = New String(noDups.Count-1){}
         noDups.CopyTo(uniqueItems)
        
         Return String.Join(",", uniqueItems)
End Function

SharePoint 2010 Form Based authentication for MS CRM 2011 Plugins

Some time you need to add, delete, or update custom items in a list on the SharePoint 2010 when plugins in MS CRM is fired up. This simple function can save your time :)

Passing MS CRM 2011 CRMParameter from ribbon button to Silverlight application

It’s pretty cool when you can pass CRMParameters to Silverlight application. To do that we need to get “location” :

public static string GetCRMParametr()
{
     if (HtmlPage.IsEnabled)
    {
        dynamic location = (ScriptObject)HtmlPage.Window.GetProperty("location");
        string crmParametr = location.search;
        if(!string.IsNullOrEmpty(crmParametr))
       {
           return crmParametr
        }
    }

return null;
}

You can add some kind of dummy parser to extract guid’s from passed parameters:

Monday, October 31, 2011

How to copy Microsoft CRM 2011 organization on the same server.

There are many reasons to copy organizations, one of the most common - for testing purpose.
You can do as following:
1. Select a database in SQL Server Management Studio which will be copied (TEST_MSCRM). Right click on the target database -> Tasks -> Backup.