ThreeMammals / Ocelot

.NET API Gateway
https://www.nuget.org/packages/Ocelot
MIT License
8.32k stars 1.63k forks source link

Why is Ocelot requesting for 1-2 minutes using the https protocol in an IIS environment? #1691

Closed songlin-q closed 10 months ago

songlin-q commented 1 year ago

Ocelot in IIS environment, using https protocol for request, request 6-7 times, it will be lagged, each time the waiting time is about 1-2 minutes

raman-m commented 1 year ago

:grin: You are not alone! See: IIS issues

raman-m commented 1 year ago

Hi Q! Thanks for your interest in Ocelot!

I would say, Ocelot is not optimized for IIS deployments and it is not recommended to deploy Ocelot app to IIS. Also, we have some IIS Gotchas. 😸 Such kind of custom environment requires a special ASP.NET MVC pipeline settings to run successfully. Each version of .NET framework requires special setup of ASP.NET MVC pipeline to support IIS. You haven't described your IIS version and .NET version and Ocelot version! To be fair, IIS has a vast and unstable pipeline, which is based on IIS modules and handlers, and which is better optimized for ASP.NET Web apps with frontends (aka Razor, Blazor), not just ASP.NET Wen API apps. Yes, we can host Web API apps in IIS environment but this scenario has overheads. I would recommend you to deploy to Kestrel web server (self-hosting), Docker or public cloud providers like Azure.

Tell me please, Why do you use IIS for Ocelot app deployments?

raman-m commented 1 year ago

Regarding slow response from IIS...

Ocelot in IIS environment, using https protocol for request, request 6-7 times, it will be lagged, each time the waiting time is about 1-2 minutes

It seems, developer from #1657 had the same problem of slow responses. The problem could be wrong usage of InProcess setup for IIS. So, Out-of-process hosting model must be used for IIS deployments!!!

Read these docs:

songlin-q commented 1 year ago

Thank you for your reply

raman-m commented 1 year ago

Hi @qs991 ! Did my reply help you? Can we close the issue?

sunilnetin commented 11 months ago

Hi