Skip to content

Instantly share code, notes, and snippets.

@paulyuk
Last active September 23, 2024 10:11
Show Gist options
  • Save paulyuk/9b53b4ed573e098030f6fc50f940a0cf to your computer and use it in GitHub Desktop.
Save paulyuk/9b53b4ed573e098030f6fc50f940a0cf to your computer and use it in GitHub Desktop.
Flex Consumption Scaling Under the Hood Notes

Slides

[https://paulyukstoragev2.blob.core.windows.net/flex-under-hood/functions-scale-under-hood.pptx]

Gist with CLI terminal commands

[https://gist.github.com/paulyuk/7609612ad5330e4e3aaf66b844b93075]

End to end sample we load tested (e2e with HTTP, EH & VNET)

[https://aka.ms/flexconsumption/samples]

AI RAG sample with concurrency=1

[https://github.com/eamonoreilly/AzureFunctionsOpenAI-RAG-Assistant]

Set concurrency=1

.. for messages using host.json

    "extensions": {
        "serviceBus": {
          "maxConcurrentCalls": 1
      }

.. for HTTP in portal/ARM/Bicep/Cli

export RESOURCE_GROUP="rg-flex-eh-oslo-con8"
export SERVICE_API_NAME="func-api-m35reac5p4h4a-functions"
export CONCURRENCY=1
az functionapp scale config set --resource-group $RESOURCE_GROUP --name $SERVICE_API_NAME --trigger-type http --trigger-settings perInstanceConcurrency=$CONCURRENCY

Flex consumption scaling docs

https://github.com/azure/azure-functions-flex-consumption/blob/eh-over-mi/flex-consumption-scale-and-concurrency.md

Diagnose and Solve Azure Functions (tons of detectors and metrics graphs)

https://learn.microsoft.com/en-us/azure/azure-functions/functions-diagnostics

Enable scaling logs

https://learn.microsoft.com/en-us/azure/azure-functions/configure-monitoring?tabs=v2#configure-scale-controller-logs

Monitor scaling logs

https://learn.microsoft.com/en-us/azure/azure-functions/analyze-telemetry-data#query-scale-controller-logs

How to conquer Cold Starts

https://thenewstack.io/how-to-conquer-cold-starts-for-better-performance/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment