CRM2011: Performance issue with plug-in on SetState RRS feed

  • Question

  • Hi,

    I have plug-in, that triggers on SetState of a custom entity. Basically it creates a successor and a bunch of related records (modifications of the original ones). The original record is not manipulated in the plugin.

    The plugin is registered synchronous, post stage. There are no further Plug-Ins handling that entity or any of the related entity that are created during that process.

    When I test the plug-in isolated (that is mocking the context using Rhino.Mock but passing a real OrganizationServiceProxy) it takes about 5.5 seconds. Not very fast, but OK regarding the heavy work done.

    Setting the state of the custom entity in code with the plug-in deactivated takes about 0.8 seconds.

    Now setting the state with the plug-in activated takes more than 90 seconds!

    Anybody has an idea, what makes it so extremely slow (about 14 times slower than SetState + plug-in isolated)? I'm desperately looking for any ideas here.

    In Addition, it get's that slow, when more than about 90-100 of those custom entities are related to a contact, when I change the state for one of those contact's entities.

    Wednesday, August 28, 2013 2:06 PM

All replies

  • I would take a look at the logs after enabling tracing.  You might have a recursion issue somewhere where you are triggering your plugin from with the plugin by some action.

    Jamie Miley

    Check out RBA Today!

    Check out my about.me profile!
    Linked-In Profile
    Follow Me on Twitter!

    Wednesday, August 28, 2013 8:45 PM
  • Hi Jamie,

    I don't think there is a recursion issue. I'm sure this would have occured as well when testing the plug-in in isolation, since I used a real CRM Connection and the plug-in was active during that test.

    Enabling tracing produced round-about 50 MB of logfiles. It's like looking for a needle in a haystack. As far as I can tell at the moment:

    • There is no long running query (>0.2 seconds), so I don't think it's some kind of locking issue on SQL server level
    • No Errors have been logged
    • No warnings have been looged

    Any idea, what to search for?

    Thursday, August 29, 2013 7:13 AM