Showing posts with label iis-10. Show all posts
Showing posts with label iis-10. Show all posts

Thursday, July 26, 2018

IIS 10 Application Pool fall a sleep

Leave a Comment

We have ASP.NET Core application used internally which are used during office hours and a batch that should be processed 3 AM every morning which is scheduled by HangFire like this:

RecurringJob.AddOrUpdate(                 () => MyBatch(),                 "0 0 3 1/1 *"); 

The problem is that the Application Pool goes to sleep and the batch isn’t processed if the site isn’t manually started (by going to the website usually).

I have searched SO and tampered with these settings in the Application Pool but with no success: enter image description here

Some sources that I used to modify the settings:

The Application Pool is used by a total of 7 applications (all being inactive during night when the batch should be processed). The used Application Pool uses .NET CLR Version 2.0. I'm using IIS version 10.0.17134.1.

How can I make the Application Pool stay active so the batch can be invoked regularly every morning?

3 Answers

Answers 1

They got documentation on how to set up service to run without stopping.

http://docs.hangfire.io/en/latest/deployment-to-production/making-aspnet-app-always-running.html#enabling-service-auto-start

My experience (with older IIS versions 7.5, 8.0) is that it works, but not for app pool recycle/domain unload. Workaround for me was to send init request on the application_end event.

Answers 2

As above - you need to enable the Service Autostart - in addition to this, if you hit multiple exceptions, I have found that the Rapid Fail Protection has shut down Application pools in the past when using HangFire. So it's also worth disabling (or increasing to reasonable limits) this on the application pool.

Answers 3

I'd suggest you put in your process a single call to the HTTP address first, just like a ping, that would be enought to trigger the site startup if it isn't running for some reason.

One other thing is that, by microsoft's description at MSDN the "AlwaysRunning" option would be:

"Specifies that the Windows Process Activation Service (WAS) will always start the application pool. This behavior allows an application to load the operating environment before any serving any HTTP requests, which reduces the start-up processing for initial HTTP requests for the application."

That may be, to produce the compilation of web pages that is done on the first call to be done before any request coming, but may not actually run the application at all times.

Read More

Sunday, May 8, 2016

How to create a deployment package with SQL scripts in IIS

Leave a Comment

Using IIS-10, Web Deploy v3.6, Windows 10.

It is an ASP.NET Website (not application) using SQL Server 2014 for the back-end.
I was able to successfully create and deploy the package, but without SQL scripts. Could not find any info on how to do it for including SQL scripts in the package. Here is what I have tried:

  1. In IIS, under 'Default Web Site', select my web application.
  2. On the right hand side, click on 'Export Application'.
  3. Click on 'Manage Components'. Choose 'dbFullSql' as Provider name. For Path, enter connection string.
    eg: Data Source=xxx.xxx.xx.xxx;Initial Catalog=MyDB;Persist Security Info=True;User ID=testuser;Password=test@345;

When clicked on OK, nothing happens. The processing icon keeps showing. It had to be closed using task manager. enter image description here Also tried with the path of the .sql file, instead of connectionString. But no idea about what parameters to be entered& how /where to mention the connection string.

I would appreciate if anyone could guide me with the right procedure.

0 Answers

Read More