Customer Engagement & Dynamics CRM Forum

Expand all | Collapse all

Custom sandbox plugins performance vs full trust

  • 1.  Custom sandbox plugins performance vs full trust

    GOLD CONTRIBUTOR
    Posted 23 days ago
    Good morning all,
    Just curious if others have ever encountered performance issues while registering plugins in sandbox mode in v9, rather than registering them in full trust?
    We are upgrading to v9 this summer (on-premise) from 8.2.  The exact build number is 9.0.8.15 and matches in the app and DB.
    I have a custom workflow activity that will send data from an entity (generic) and send it to an external endpoint.
    In our upgraded environment, I tried running a workflow that uses this activity with the plugin registered in full trust (no isolation) vs sandbox mode.
    Note that these times are recorded by my plugin, so we're ignoring delays in running the workflow. This is all time spent within the plugin.

    The call to the external web service took 80 ms, and total execution was 520 ms.

    When I register in sandbox:
    The call to the external web service took 15 seconds, and total execution was 48 seconds.

    Tested on another record:
    full-trust: 180ms for external web service call, 2 sec 380 ms for total execution
    sandbox: 2 sec 570 ms for external web service call, 31 sec 570 ms for total execution

    So I'm seeing exponentially slower performance.  Is this kind of performance difference between sandbox mode and full-trust plugins expected?  Have others encountered something like this before?

    ------------------------------
    Mike Power
    Senior CRM Solutions Developer
    American University
    Washington DC
    ------------------------------
    Academy - Online Interactive Learning from Experts


  • 2.  RE: Custom sandbox plugins performance vs full trust

    TOP CONTRIBUTOR
    Posted 11 days ago
    Wow, that's a massive slowdown. It's a long time since I registered anything not in sandbox so I don't have the non-sandbox numbers to compare, but we don't see performance anything like that bad in sandbox. I think you've got something else going wrong there somewhere. My first step would be to turn on tracing on the sandbox server and see if that highlights anything.

    ------------------------------
    Mark Carrington
    Chief Technologist
    Data8
    Chester
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 3.  RE: Custom sandbox plugins performance vs full trust

    GOLD CONTRIBUTOR
    Posted 4 days ago
    Interestingly enough, it seems to stem from Windows Defender.  I noticed mspeng.exe was always using CPU.  Not a ton, maybe 12-25%, but all the time.  So I disabled Windows Defender and immediately the plugins all went at similar speeds as full trust was before.  I re-enabled Windows Defender, and immediately it slowed down to the same pokey pace.
    I compared to our production servers, where we have a sandbox plugin that performs fine, and I didn't see any difference in how Windows Defender was configured.  Neither server has any file/folder exclusions configured.
    So I'm not sure what's different, but at least I know it traces back to Windows Defender.  If anyone has any tips regarding Windows Defender (on Windows Server 2016 in a VM with vSphere) and Dynamics 365, I'm all ears :)

    ------------------------------
    Mike Power
    Senior CRM Solutions Developer
    American University
    Washington DC
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 4.  RE: Custom sandbox plugins performance vs full trust

    MICROSOFT MVP
    Posted 3 days ago
    Hi Mike,

    I had a problem with antivirus impacting performance of an on-prem server many moons ago.  There is guidance on configuring antivirus for Dynamics 365 servers in the form of a blog post from Microsoft's Premier Field Engineer team, but it's going back a few years:

    https://community.dynamics.com/crm/b/crminthefield/posts/anti-virus-exclusions-for-microsoft-dynamics-crm

    Obviously, any changes to anti-virus config are a balance between performance and security so make sure you're confident in any changes made.

    Hope this helps.

    Best regards,
    Andrew.

    ------------------------------
    Andrew Bibby
    D365UG UK Leader
    Dynamics 365 Project Adviser & Microsoft MVP
    Evesham, UK
    ------------------------------

    Academy - Online Interactive Learning from Experts


If you've found this thread useful, dive deeper into User Group community content by role