Why is HTTPS request hanging after 6 request in a row with WebKit based browsers and IIS? #1743
-
Expected BehaviorI've setup a couple of sample ASP.Net 6 APIs, one of them with Ocelot as the gateway, and tried to route requests to a given endpoint to a donstream API. Debugging with Rider everything works fine, and deployed to IIS works also fine if I configure HTTP bindings, but If I set up HTTPS bindings for both APIs and configure Ocelot routing to use HTTPS protocol, I would expect it to work OK, as through HTTP. Actual BehaviorIf I configure Ocelot to route through HTTPS, every 7th request from a WebKit based browser (I've tested Chrome and Edge in their latest versions) hangs for an undetermined time. Some things I've tested so far
Steps to Reproduce the Problem
Specifications
|
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 11 replies
-
Is it a question or real issue, in your opinion, Alejandro? |
Beta Was this translation helpful? Give feedback.
-
Hello @aggutierrez, are you experiencing the same issue as others with IIS? |
Beta Was this translation helpful? Give feedback.
-
Hi, @raman-m! It's mainly a question. I'm not sure it has 100% to do with Ocelot but I need to gather some info. |
Beta Was this translation helpful? Give feedback.
-
Hi @ggnaegi! It behaves more or less like those issues, but in my case it's always at the 7th attempt. Also, I tried modifying the ocelot.json to redirect to the donwstream API using the IP address, instead of the domain name, as they suggest in one of the issues but that doesn't fix it and I keep reproducing this same behavior. To be honest, to me it looks like it has to do with how WebKit browsers understand the end of a connection and how IIS implements HTTP/2. It looks like if the browsers never killed the previous threads, waiting for the server to finish the connection, and at some point they reach the maximum number of threads available, so the 7th request has to wait for a thread to be available. If I call the endpoint from Bombardier, for example, I've no issues and I can call any number of times. |
Beta Was this translation helpful? Give feedback.
-
@aggutierrez I don't recommend to host Ocelot app by IIS. You must tune and provide correct settings for all IIS features, modules, handlers... you know this is a pain in the neck! IIS is a web server for classic web apps with ASP.NET front-ends. For ASP.NET Web API apps without front-ends it is better to use lite web servers like Kestrel. I have no idea how to provide correct IIS settings for HTTP/2 protocol, but technically Ocelot should support HTTP2. You have to read tons of articles on how to setup IIS for HTTP/2. |
Beta Was this translation helpful? Give feedback.
-
I have some ideas for this. One apigateway using ocelot, A and B application server behind gateway. Apigateway use https, A and B server using http as they are as localhost server downstream. Then I test, closing apigateway HTTP/2 function on iis. Then apigateway gets all requests by HTTP/1.1, it works, no stalled. |
Beta Was this translation helpful? Give feedback.
@aggutierrez wrote on Oct 13:
If you have a route to HTTP2 downstream service, you have to specify correct DownstreamHttpVersion property value.
Also, pay attention to #1673 please!
Another critical common problem with IIS hosting when Nth request being hanged is an IIS Gotcha. It could be #1657 or other issue...
Try to test #1657 user scenario and share a feedback plz...
As I said below, Ocelot allows to route HTTP2 traffic but…