WIP
Here I’m trying to figure out – how much PowerShell Parallel option is beneficial and how to avoid throttling…
Let us test, how long would it take to create a SharePoint site, if we use regular (sequential) loop or parallelism (I’m creation a sample set of 50 SharePoint Sites in a row):
Regular (Sequential) seconds per site | Parallel, 100 sites in batch seconds per site | Parallel, 500 sites in batch seconds per site | |
Regular (Sequential) | 3.0 | ||
Parallel, ThrottleLimit = 2 | 1.60 | 0.91 | |
Parallel, ThrottleLimit = 5 | 0.69 | ||
Parallel, ThrottleLimit = 10 | 0.2 – 0.3 | ||
Parallel, ThrottleLimit = 20 | 0.17 |
Interesting, but I did not get even one (throttling or any other) error during creation 500 sites.
Get sites details
Now let us test, how long it takes to get sites details with Get-PnPTenantSite (I use a sample set of 500 sites):
Test type | Regular (Sequential), seconds per site | Parallel sample = 100 sites, seconds per site | Parallel sample = 200 sites, seconds per site | Parallel sample = 500 sites, seconds per site |
Regular (Sequential) | 0.65 | |||
Parallel, ThrottleLimit = 2 | 0.40 | 0.33 | 0.31 | |
Parallel, ThrottleLimit = 5 | 0.17 | 0.14 | 0.36 (errors) | |
Parallel, ThrottleLimit = 10 | 0.11 (errors) | 0.11 (errors) | 0.34 (errors) | |
Parallel, ThrottleLimit = 20 | 0.12 errors+ | 0.07 errors+ | 0.52 (errors) |
(errors) means there were small number of errors during test… e.g.