How to get more out of your Dynamics CRM Server

The CRM web service has a cruisy job really, it has single create, update, delete operations, most of the time your grunty server out the back will be idling.


Recently on a project we needed to simultaneously create 200+ records per transaction, unfortunately there is no bulk create.

The quickest way is to put the 8 idling cores into good use using the ThreadPool.QueueUserWorkItem method.

{ThreadPool.QueueUserWorkItem((o) =>
object[] state = (object[])o;
// execute crm web service calls here

}, new object[] { context, contact });


What to use take 6-8 seconds to create 200 records now completes within 2 seconds.


A little gotcha is if you’re using CredentialCache.DefaultNetworkCredentials, it will give you a 401 unauthorized error; please make sure you impersonate the multiple threads correctly.

Refer to and for more information about impersonation.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: