Running multiple IServer's #27213
Labels
affected-very-few
This issue impacts very few customers
area-networking
Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
enhancement
This issue represents an ask for new feature or an enhancement to an existing one
Needs: Design
This issue requires design work before implementating.
severity-nice-to-have
This label is used by an internal tool
Milestone
The current web host builder is designed to only work with only one IServer. It even relies on the DI behavior of using the last one registered so IIS can dynamically replace kestrel. We've had a few requests for applications that want to run Kestrel + HttpSys for example, to take advantage of their different capabilities. They don't want to start two processes or two hosts, they want to share a DI container, host infrastructure, and app pipeline.
From a pipeline perspective this should be fine, requests are processed one HttpContext at a time so there shouldn't be any cross contamination issues between the servers. The issues are mostly around setup.
Challenges:
A) Activation: how do you configure the host to create and start multiple servers? Could IIS be supported as one of those servers, or just Kestrel and HttpSys? Could you have multiple instances of one kind of server like Kestrel?
B) Configuration: how do you configure the bindings for those servers? They'd both try to consume the shared ASPNETCORE_URLS config. Luckily each server has its own programmatic config API.
C) IServerAddresses: This advertises the bindings for the server to the application. The servers would have to avoid stomping on eachother updating this.
D) What middleware make assumptions about working with a single server?
aspnetcore/src/Security/Authentication/Negotiate/src/PostConfigureNegotiateOptions.cs
Lines 29 to 56 in 8dedfde
aspnetcore/src/Servers/IIS/IISIntegration/src/IISMiddleware.cs
Lines 120 to 125 in 8dedfde
The text was updated successfully, but these errors were encountered: