@Nic Markram Welcome to Microsoft Q&A Forum, Thank you for posting your query here!
I understand that you are encountering many warning messages [Warning] [HostMonitor] Host CPU threshold exceeded (81 >= 80)
for your Azure function app.
Refer to this document: Host Health Monitor · Azure/azure-functions-host Wiki · GitHub, the actual thresholds used by the monitor are a percentage of these maximums (default is 0.80).
Please consider reducing the concurrency calls per instance and check if that helps. Refer this.
For a function app that processes a large number of I/O events or is being I/O bound, you can significantly improve performance by running functions asynchronously. For more information, see Improve throughout performance of Python apps in Azure Functions.
Also try to add the app setting "FUNCTIONS_WORKER_PROCESS_COUNT" and set the value in between 2 and 10. This setting specifies the maximum number of language worker processes, with a default value of 1. Start from lower value and try increasing it slowly until you find the optimal value for your app.
You can set the value of maximum workers allowed for running sync functions using the PYTHON_THREADPOOL_THREAD_COUNT application setting. For mixed workloads apps, you should balance both FUNCTIONS_WORKER_PROCESS_COUNT
and PYTHON_THREADPOOL_THREAD_COUNT
configurations to maximize the throughput. Start from lower value and try increasing it slowly until you find the optimal value for your app.
Please refer this article for more information about Python Function App performance optimization.
Also read the below comment for similar issue from this github thread.
Also See how dynamic concurrency works in Azure Function App with a simple test. More info here.
To Improve the performance and reliability of Azure Functions, refer this article.
**
Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.