SPC11: Planning and managing sandboxed solutions (SPC376)

Almost right away, Maurice Prather announced that his session was for IT PRO’s. Now, I’m not an IT PRO kinda guy, but I decided to stay anyway. And I’m glad I did.

Maurice started talking about the SPUSERCODESERVICE. Right away, I was surprised to discover that the Sandbox Service is by default configured to 1 worker process and 1 connection per process. So only 1 user at a time can use a sandboxed solution. Not very usefull…
So, if you’re not aware of this default configuration, and start using sandboxed solutions on your production environment, you’ll get errors in no time at all.

You can look at the configuration in Powershell:

$sandbox = [microsoft.sharepoint.administration.spusercodeservice]::local

If you haven’t modified the sandbox configuration yet, you will see:
ResourceMaxValue = 2147483647 (resource points)
MaximumWorkerProcess = 1
MaximumConnectionsPerProcess = 1

And then it got even more interesting.

By default, there’s only one tier for the SPUSERCODESERVICE. A tier in this context can be configured to behave in a certain way, depending on the configured values.

So, what you want to do is configure several tiers that control the way sandboxed solutions are controlled.
Based on the metrics and behaviour of the sandbox solution, SharePoint will decide in which tier the solution will be run.

Maurice gave a great example where he configured 3 tiers:

Tier 1: Good solutions
ResourceMaxValue = .05 (resource points)
MaximumWorkerProcess = 2
MaximumConnectionsPerProcess = 10
This tier will be used for ‘good’ solutions that use few resources. 10 users will be able to use this concurrently.

Tier 2: Iffy solutions
ResourceMaxValue = .25 (resource points)
MaximumWorkerProcess = 4
MaximumConnectionsPerProcess = 5
This tier will be used for ‘iffy’ solutions. we will give it some more worker processes and 5 users will be able to use this concurrently.

Tier 3: Bad solutions
ResourceMaxValue = 2147483647 (resource points)
MaximumWorkerProcess = 5
MaximumConnectionsPerProcess = 1
This tier will be used for ‘bad’ solutions. we will give it more worker processes and only 1 user will be able to use this.

When a ‘bad’ solution is run, only 1 user is permitted to use it. When the process is killed by SharePoint, only 1 user suffers.
When a ‘good’ solution is run, 10 users are permitted to use it. The change that this solution will be killed it a lot less, because SharePoint knows by the metrics of the solution that it is a ‘good’ solution.

Good stuff in this session. I have got a much better understanding of how we can configure SharePoint to get our sandbox environment much more stable and responsive. Gladd I stayed the course!

Leave a Reply

Your email address will not be published. Required fields are marked *