Skip to content

Commit 8e99c16

Browse files
committed
Adding information around concurrency.
1 parent 8ca4ed6 commit 8e99c16

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

articles/azure-functions/functions-reference-powershell.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -511,17 +511,7 @@ You set this environment variable in the [app settings](functions-app-settings.m
511511

512512
### Considerations for using concurrency
513513

514-
PowerShell is a _single threaded_ scripting language by default. However, concurrency can be added by using multiple PowerShell runspaces in the same process. This feature is how the Azure Functions PowerShell runtime works.
515-
516-
There are some drawbacks with this approach.
517-
518-
#### Concurrency is only as good as the machine it's running on
519-
520-
If your function app is running on an [App Service plan](functions-scale.md#app-service-plan) that only supports a single core, then concurrency won't help much. That's because there are no additional cores to help balance the load. In this case, performance can vary when the single core has to context-switch between runspaces.
521-
522-
The [Consumption plan](functions-scale.md#consumption-plan) runs using only one core, so you can't leverage concurrency. If you want to take full advantage of concurrency, instead deploy your functions to a function app running on a dedicated App Service plan with sufficient cores.
523-
524-
#### Azure PowerShell state
514+
PowerShell is a _single threaded_ scripting language by default. However, concurrency can be added by using multiple PowerShell runspaces in the same process. The amount of runspaces created will match the PSWorkerInProcConcurrencyUpperBound application setting. The throughput will be impacted by the amount of CPU and memory available in the selected plan.
525515

526516
Azure PowerShell uses some _process-level_ contexts and state to help save you from excess typing. However, if you turn on concurrency in your function app and invoke actions that change state, you could end up with race conditions. These race conditions are difficult to debug because one invocation relies on a certain state and the other invocation changed the state.
527517

0 commit comments

Comments
 (0)