Azure / Azure/azure-functions-host

[feature request] Option to register different Functions on separate hosts

Open
#7,142 8 comments 0 reactions 1 assignee Claimed by @soninaren View on GitHub
Needs: Triage (Functions)
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 10h
Merged PRs (30d)
36

Description

**Scenario**

I have a use-case where I'm using Durable Entities in a high-throughput scenario on consumption.

In the same Function App, I also have a simple Http Trigger where I perform a read on the entity state and return a response.

**Problem**

When Durable Entities is under load, there is not enough available resource to reliably serve requests to the Http endpoint.

What I observe is random 429s - I am 90% sure that the 429s are given when the Http request is routed to host which is under significant load due to a loaded Durable TaskHub partition.

**Solutions attempted/rejected**

I have disabled `dynamicThrottlesEnabled` in the App, which does solves the problem, however the duration to serve the http request is very long - between 20 - 40 seconds which is too long, and won't scale to the needs of my customers in this multi-tenant product.

I am also worried that by disabling `dynamicThrottlesEnabled` this is going to compromise the stability of the Durable part of the function App.

The only other option I have is to pull out the Http Trigger endpoint into its own Function App, and call into Durable Entities remotely. However, I do not like approach as my Function App represents a deployable domain boundary/service boundary (a microservice, if you will) - splitting it over two Apps increases complexity, maintenance and cognitive load.

**What I would like**

Aspirationally, the http requests would always be routed to a host that isn't under load, and that would be the end of the problem, but I understand the many complexities in achieving this.

Alternatively, could the scale controller be given a hint to only register the Http endpoint on a host which is isolated away from the durable endpoints? With this I could ensure that the Http Trigger has isolated & scalable bandwidth to serve all my http traffic, while still allowing the hosts running Durable partitions to execute to their maximum utilisation.

This also ties into a model which would allow me to host durable Activities on different isolated hosts to anything else to ensure that activities are not being compromised by other things which are underload in my App.

I would see this manifest as a `host.json` configuration where I can describe which functions belong to different scale units, something like this maybe?

```
{
"version": "2.0",
"extensions" : { ... },
"scaleUnits": [
{
"Orchestration-backend": [
"MyOrchestrationA",
"MyOrchestrationB",
]
},
{
"Activity-backend": [
"MyActivityA",
"MyActivityB,
]
},
{
"Frontend": [
"MyServiceBusTrigger",
"MyHttpTrigger"
]
}
]
}

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.