Azure / azure-functions-host

The host/runtime that powers Azure Functions
https://functions.azure.com
MIT License
1.93k stars 440 forks source link

Function scales to 0 instances under load. Only wakes up when opened in Azure Portal #8911

Open Hjortsberg opened 1 year ago

Hjortsberg commented 1 year ago

Check for a solution in the Azure portal

Have checked through almost all detectors, the errors I find is related to the swap action and no host errors after the swap completed.

Investigative information

This Azure Function is under constant load at around 900req/min from an EventHub trigger so from my perspective, it should never scale down. This has worked flawlessly for some time. Yesterday we swapped in some new code, and suddenly this function starts to just die on itself by scaling down to zero instances and not waking up. Does however wake up every time i navigate to the Azure Function resource in the portal, which is weird (see attached screenshots).

The below invocation information is when it scaled to zero for the first time. Please provide the following:

Repro steps

When function has scaled down to zero, use the invocation information above to navigate to the function and it will start to process events again.

Expected behavior

The function should not scale to zero and process my constant stream of EventHub requests.

Actual behavior

From application insights. function-dead-explain Timestamps in detector are offset compared to above picture due to timezone difference. app-offline

Execution stops for no apparent reason, starts when resource is visited in the Azure Portal.

Related information

Provide any related information