-
Notifications
You must be signed in to change notification settings - Fork 25.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IIS Idle Timeout #12232
IIS Idle Timeout #12232
Comments
@sebastienricher ... for the most recent 👊 bar brawl 👊 convo, see dotnet/aspnetcore#3849 ....... it's a knife 🔪 fight in there 😄, so be ready. Do feel free to add your own feedback. The engineers do take your feedback into consideration as they design and implement scenarios for the framework.
Leave this open @sebastienricher ... I'd like to add a section that lays out the options or goes with whatever the engineers prefer that devs use. There will be a delta (probably) for in-process vs. out-of-process (i.e., out-of-process probably works with the external ping the best), and I'd like to get that difference covered, too. |
Sounds good, I can chime in with the final selection when I have it. One thing that might be to consider also is the Application Pool's .NET CLR Version, in the current tests I'm running, I have it set to No Managed Code. |
That's correct ... the CoreCLR is is booted to host the app in the worker process. You should be able to leave that set just like you have it and the methods that I listed should work. 🤞🍀 ... don't forget to sacrifice a Microsoft mouse to the 🙏 server gods 🙏. 😄 ... it couldn't hurt. 😄 When I get to this issue, I'll see about clarifying the app pool .NET CLR version setting in one or two other spots. Right now, it's only directly covered in the IIS set up instructions (and it doesn't say why one is setting it that way) ... https://docs.microsoft.com/aspnet/core/host-and-deploy/iis/#create-the-iis-site Of course, it doesn't matter (much) if it's set. There might be a very VERY tiny penalty of like microseconds on server start/app pool recycle to have it set AFAIK from talking to the engineers, but I think the language could use a tiny touch of work to clarify it. |
Good news, I tried "Always running + idle timeout set to 0 (zero) + preload enabled.", initial tests are positive! I'll drill it some more but both my site seems to be staying warm and the hosted services keep running every 15 minutes. Thanks for pointing me in the good direction! |
Cool ... did you test an app pool recycle, too? Also ... and similar to a recycle, did you test a total server restart? Does the app get up and running without intervention? [EDIT] Sorry ... I meant to say that the Application Initialization Module should get it started in these scenarios, too. |
You're right, that's what I'm seeing now. Once the Application is actually started it does not go to sleep as wanted, but when there is a recycle, it does not come back up on it's own. I'll look into the initialization module, it seems to be the reliable way to go about this from both your indications and related posts. |
Check and confirm that the server role feature for Application Initialization is enabled. |
I'm going to take another look 👀 at https://docs.microsoft.com/iis/get-started/whats-new-in-iis-8/iis-80-application-initialization |
According to IIS's docs, it should ✨ Just Work™️ ✨. I need to dig into the subject a bit more and perform some testing here, too. I'm buried in file upload code at the moment, but I should be free (free-ish 🏃😅) within two weeks to take a deeper look. My impression of the most reliable way to keep an IIS-based ASP.NET Core app started and warm is .... drum roll plz .... 🥁🥁🥁🥁🥁 .... external service pings. ei ei ei ... I know ... I know. That's not good. I just say that because I've seen this come up over-and-over for two years now and the devs who say that they use an external service to ping their apps seem to live with the least stress in their lives. |
..... well .... I'll add this to that .... the devs who moved their always-running service things to a Windows Service also seem very happy. Consider that option, too. Get your always-must-run-ALWAYS! stuff off of IIS. That's a good option, too. |
Yeah I need IIS for internal certificate and infrastructure reasons, but it is a viable last recourse. I'm all setup with application initialization, but I'm still not getting warmed up. Added this to web.config:
Also using https://serverfault.com/questions/590865/how-can-i-warm-up-my-asp-net-mvc-webapp-after-an-app-pool-recycle/595215#595215 as reference. |
I'm surprised that the preload setting doesn't do it.
I'll mark this issue with the PU label, but I might get to it before engineering takes a look. In that case, I'll do the best I can (and do my own testing here as you're doing there). If the PR goes in before they look at this issue, then they'll be pinged to review the PR, and that should lead to final answers on guidance. They might get to looking at "PU"-labelled issues soon now that Preview 4 is out. |
As a reference, I'm running on HTTPS, so I am looking here for part of the solution also: https://support.microsoft.com/en-ca/help/2843964/application-initialization-module-fails-when-web-site-requires-ssl |
Do we know what URL is used for that? This would be subject to the site's bindings? |
Good question ... we need PU (product unit) support. Now that I've marked this issue, engineering ( |
@sebastienricher It looks like the answer is yes to your suggestion on the binding port ... and it goes to
I'll be working this one very soon, including some local testing to see what's what with my own 👀. I'll ping u on the PR when it goes up. |
I have hosted services running in process on IIS, do these refresh the IIS idle timeout?
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: