Load Balancing in Sandboxed Solution Management is managed in two ways.
- All Sandboxed code runs on the same machine as a request.
- Requests to run Sandboxed code are routed by solution affinity.
To get how the execution of code in Sandboxed Solutions is distributed across the Servers, using PowerShell, please use the command given below.
$sandcode=[Microsoft.SharePoint.Administration.SPUserCodeService]::Local
$sandcode.UseLocalServerOnly
If it returns true, this means that it's an option 1 = 'All Sandboxed code runs on the same machine as a request'.
If it returns false, this means that it's an option 2 = 'Requests to run Sandboxed code are routed by solution affinity'.
I hope this helps.