You are viewing limited content. For full access, please sign in.



possible problematic scenarios of script domain model being set to single mode in Workflow Admin

asked on August 24, 2015

I have been playing with the idea of changing script domain model from isolated to low for performance boost of my scripts. I was wondering about what kind of scenarios that can cause "unintentional side effects" as the help guide mentions. Also, what are those unintentional side effects that is being warned about. 

2 0


replied on August 25, 2015 Show version history

If you are looking for boosts to script activities run speed, I'd look at the following two options. 

First, in Advanced Server Options, uncheck Script activities in 'Run the following activities as a tasks'. This option will change scripts to run directly as part of the workflow execution instead of in a separate, throttled work queue. We throttle scripts by default because we have found they tend to access resources that are often overloaded by too many simultaneous thread requests. 

Second, and to answer your question, I'd go with Shared over Single . The performance gain between Isolated and Shared can be huge. The performance gains from Shared to Single are more memory related then speed related. 

The scripting domains control what AppDomain the scripts are loaded into. Scripts that are loaded into the same app domain have access to the same static class members as other scripts. They can also access these static members concurrently in different threads if more then one workflow instance is running so thread safety potentially becomes important. 

So the logic of the safety ratings is this:

Isolated, everything is pretty much safe to run. There is a very low chance of code between two scripts interacting with each other unexpectedly. 

Shared -> Everything authored by the same person in a workflow runs together, so that person can be responsible for ensuring safety. Lower safety rating because workflows can have multiple authors and you have to remember everything you did when you come back to the workflow months and years later.

Single -> Really only safe if all workflows are authored by the same person and that person understands the code they are using.



3 0
replied on August 25, 2015

Thank you Ed. That was very helpful.

0 0


replied on August 25, 2015

Here is an old graph I had when we first implemented this option that did a basic script of setting a token. 

I typically do 1000 instance tests when making my performance graphs. The first column is Single, the second column is Shared, the third column is Isolated. 







2 0
You are not allowed to follow up in this post.

Sign in to reply to this post.