Skip to content

Commit 29782e4

Browse files
committed
edits to Anirudh's additions
1 parent 6bee0e0 commit 29782e4

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

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

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -280,35 +280,37 @@ Likewise, you can set the `status_code` and `headers` for the response message i
280280

281281
## Concurrency
282282

283-
The Functions Python runtime can only process one invocation of a function at a time. This concurrency level might not be sufficient if you are trying to handle a number of invocations at the same time and/or if your application is processing a lot of I/O events (i.e. your application is I/O bound).
283+
By default, the Functions Python runtime can only process one invocation of a function at a time. This concurrency level might not be sufficient in under one or more of the following conditions:
284284

285-
For these we recommend the following
285+
+ You are trying to handle a number of invocations being made at the same time.
286+
+ Your are processing a large number of I/O events.
287+
+ Your application is I/O bound.
288+
289+
In these situations, you can improve performance by running asynchronously and by using multiple language worker processes.
286290

287291
### Async
288292

289-
We recommend that you write your Azure Function as an asynchronous coroutine using the `async def` statement.
293+
We recommend that you use the `async def` statement to make your function run as an asynchronous coroutine.
290294

291295
```python
292-
# Will be run with asyncio directly
293-
296+
# Runs with asyncio directly
294297

295298
async def main():
296299
await some_nonblocking_socket_io_op()
297300
```
298301

299-
If the main() function is synchronous (no qualifier), we automatically run the function in an `asyncio` thread-pool.
302+
When the `main()` function is synchronous (without the `async` qualifier), the function is automatically run in an `asyncio` thread-pool.
300303

301304
```python
302-
# Would be run in an asyncio thread-pool
303-
305+
# Runs in an asyncio thread-pool
304306

305307
def main():
306308
some_blocking_socket_io()
307309
```
308-
### Use multiple language worker processes
309310

310-
By default every Functions host has a single language worker process. However there is support to have multiple language worker processes per Functions host. Function invocations can then be evenly distributed among these language worker processes. Use the [FUNCTIONS_WORKER_PROCESS_COUNT](https://docs.microsoft.com/en-us/azure/azure-functions/functions-app-settings#functions_worker_process_count) App setting to change this value.
311+
### Use multiple language worker processes
311312

313+
By default, every Functions host instance has a single language worker process. However there is support to have multiple language worker processes per host instance. Function invocations can then be evenly distributed among these language worker processes. Use the [FUNCTIONS_WORKER_PROCESS_COUNT](functions-app-settings.md#functions_worker_process_count) application setting to change this value.
312314

313315
## Context
314316

0 commit comments

Comments
 (0)