Answered by:
synchronous plugin vs asynchronous plugin

Question
-
Hi All,
Which gives better performance, synchronous plugin or asynchronous plugin ? why ?
How to handle that performance issue?
Any suggestions.........??????
Thanks in advance
NarSrav http://www.dynamicsexchange.com- Edited by Nar_mscrm Tuesday, February 5, 2013 1:41 PM
Monday, February 14, 2011 6:33 AM
Answers
-
The timedelay (the time CRM waits for plugin to complete) is inversly proportional to CRM performance. The more time taken to wait, the less is performance.
To optimize the performance you should
1) opt for async plugin whenever possible.
2) reduce number of calls made by plugin to CRM/other system by efficient programming.
3) consider creating web-service on the external application server to handle complex logic involving multiple connections/calls/queries to the external system. This is linked to point 2, and will reduce unnecessary traffic and other overheads involved.
Apart from this there is not much specific to CRM which you can do as it will be generic for any other .net application.
- Arvind- Proposed as answer by Jim Glass Jr Monday, February 14, 2011 5:44 PM
- Marked as answer by Nar_mscrm Tuesday, February 15, 2011 5:15 AM
Monday, February 14, 2011 9:16 AM
All replies
-
Well that totally depends on which performance are you talking about.
A scenario where the plugin is used to transfer the contact information from the CRM system to a Billing system.
1) Sync plugin -> The contact will be copied to Billing system as soon as it is created in CRM. If it fails in Billing system, you'll ge the error then and there. But the CRM system will wait till contact gets created in Billing system, thus making each transaction slow. This delay may be noticiable to the CRM user depending upon the amount of delay.
2) Async Plugin -> After the contact is created in CRM, it will be queued and send to Billing system. It may take more time for this contact to get created in Billing depending on queue status, other resource availability, etc. But here the CRM system will not wait and move on with the processing. The user creating the contact will not get any delay in saving the contact record.
- ArvindMonday, February 14, 2011 6:44 AM -
Thanks for replay...
I am talking about CRM performance and not related to time delay....
And the intervier asked how you will handle performance issue??
Any Idea how to handle performance issue in plugin?
NarSrav http://www.dynamicsexchange.comMonday, February 14, 2011 6:55 AM -
Hi,
- Plug-ins registered for synchronous processing execute immediately, whereas plug-ins registered for asynchronous processing are queued.
- That means in case of synchronous plugin the platform core operation need to wait for the completion of plugin execution.
- so you can get better performance by registering a plugin to execute asynchronously.
- But when , to opt for an aync registration depends on your requirements.
Go through the below links for better understanding:
http://www.devx.com/dotnet/Article/42660/1954
http://msdn.microsoft.com/en-us/library/cc151086.aspx
http://msdn.microsoft.com/en-us/library/cc150926.aspx
Regards,
Soumya.
soumya- Proposed as answer by VishalSwamiMicrosoft employee Monday, February 14, 2011 8:12 AM
Monday, February 14, 2011 6:58 AM -
The timedelay (the time CRM waits for plugin to complete) is inversly proportional to CRM performance. The more time taken to wait, the less is performance.
To optimize the performance you should
1) opt for async plugin whenever possible.
2) reduce number of calls made by plugin to CRM/other system by efficient programming.
3) consider creating web-service on the external application server to handle complex logic involving multiple connections/calls/queries to the external system. This is linked to point 2, and will reduce unnecessary traffic and other overheads involved.
Apart from this there is not much specific to CRM which you can do as it will be generic for any other .net application.
- Arvind- Proposed as answer by Jim Glass Jr Monday, February 14, 2011 5:44 PM
- Marked as answer by Nar_mscrm Tuesday, February 15, 2011 5:15 AM
Monday, February 14, 2011 9:16 AM -
It's totally depends upon the scenario where we registered the plugin. The sync plugin will run immediately when the message is fired. If you want to gain some performance and don't want the action at once then you make a plugin asyn. These action will happen after the system is free.
If you have any doubts go through these link:
http://social.microsoft.com/Forums/en/crmdevelopment/thread/f398ff8a-ccdd-453c-a0fb-041b86ba0c71
- Edited by BalaBramhaReddy Gajjala Friday, August 19, 2016 5:59 AM
Friday, August 19, 2016 5:57 AM