FIM CM Reference: Increasing the Max Pool Size in FIM CM

In heavy use situations some FIM CM servers may report the following error.

Timeout expired.  The timeout period elapsed prior to obtaining a connection from the pool.  This may have occurred because all pooled connections were in use and max pool size was reached.

The default pool size FIM CM uses is 100. To increase this we must change the connection string information. This is stored encrypted in the registry. Fortunately CM ships with a tool to allow us to set this DBConnectionString value. All we need to do is grab the current setting, tack on the pool increase, and write it to the registry. This article show how to do this.

WARNING: This document discusses changing an important registry value for FIM CM. Please backup the registry settings in case something goes amiss.

Steps we’ll undertake to accomplish this task.

  1. Dump the current (encrypted) DBConnectionString value
  2. Prepare the new connection string with the needed pool increase
  3. Write the new connection string to the registry
  4. Perform and IIS reset and restart the FIM CM Update service

Dump the current (encrypted) DBConnectionString value

Create a PowerShell script to retrieve the decrypted DBConnection string value.

 

 

Add-Type -assembly System.Security
Add-Type -assembly mscorlib
 
$reg = [wmiclass]‘\\.\root\default:StdRegprov’
$HKLM = 2147483650 #HKEY_LOCAL_MACHINE 
$key = "SOFTWARE\Microsoft\Clm\v1.0\Server\WebUser\"
$value = "DBConnectionString"
 
$connectionStringBinary = [byte[]]($reg.GetBinaryValue($HKLM, $key, $value).uvalue)
$connectionStringBytes = [System.Security.Cryptography.ProtectedData]::Unprotect($connectionStringBinary, $null, "LocalMachine")
$connectionStringString = [System.Text.Encoding]::Unicode.GetString($connectionStringBytes); 
$connectionStringString

From an elevated PowerShell console run the script just created.

 Prepare the new connection string with the needed pool increase

Copy the output from PowerShell and paste it into notepad.

To increase the pool size from the default value of 100 add “Max Pool Size = XXX;” where XXX is the desired size. A good starting value is 500.

Here’s my connection string after adding the new item.

Write the new connection string to the registry

To accomplish this task we need to run clmutil.exe. This tool ships in the product. It’s located in the bin directory of the installation, typically located in “C:\Program Files\Microsoft Forefront Identity Manager\2010\Certificate Management\Bin."

Just run clmutil –setdbconn with the connection string in double quotes.

I am not sure why I see “cannot write a debug message” in my output. However the command successfully updated the registry.

Verify the change is in place by using the PowerShell script again.

Perform and IIS reset and restart the FIM CM Update service

This step is pretty straight forward. After the service restarts load the FIM CM portal.