Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS application initialization module and memory management

I am researching into the IIS Application Initialization module and from what I can see, when using the AlwaysRunning option for Start Mode setting for the application pool, basically it starts a new worker process that will always run even if there isn't any requests. When applying this option it starts the process automatically.

My concern is memory management and CPU usage, specifically how is this handled since the process always runs.

How can I compare this to setting the Start Mode to OnDemand and increase the Idle Time minutes to couple of days? That way, I guess, the process will run in idle mode for x days before it's terminated, and reinitialized on the next request and keep running for a couple of days. If I set the minutes to let's say 1.5 days, someone is bound to use the application at least once a day, so it will persist the process runtime and it will never be terminated.

Can anyone share experience regarding this topic?

Thanks

like image 666
Dejan Mladenovski Avatar asked Oct 31 '22 23:10

Dejan Mladenovski


1 Answers

I have multisite application that runs few sites under separate app pools. All are set OnDemand for Start Mode and IdleTime for 1740 minutes, also I use Page Output Cache from app with different times for different page types. There is also NHibernate behind scene and DB is MySql.

The most active site have more than 100k visits per day and almost never is idle. When it starts if I recycle, need 30 seconds to 2 minutes to became full operable depending on requests at the moment and CPU usage is going from 40% to 70%. After the site is up CPU usage is very low (0-4%) if there are no new entries in DB and memory usage is around 3GB when all is cached. Sometimes CPU is going to 20% if at that moment are new request (for not cached content) and there is new entry saving. Also Page Output Cache works on First Come First Served base so maybe this can also cause little problem while caching is done - user must wait, little more CPU to do the caching.

The most biggest problem in my case is using NHibernate and MySql but Page Output Cache resolved the problem for me when I decided to cache the page modules and content. I realize that is better application to starve for memory then for CPU. 3.5k visitors at one moment when everything is cached gave to me same memory usage (3GB) and CPU (server overall) around 40% Other sites are using around 1-1.5GB memory and CPU never more then 20% at start. The application with same settings for app pool and using MSSQL with EF I can't even notice that run on server. It is used by 10-60 users in minute there is not much content except embedding codes and it use 1-5% CPU and never more than 8MB memory. On recycle it is up for less then 10 seconds.

With this my experience I can tell you that all depends on what application serves and how it works :) and how much content do you have.

If you use OnDemand with long IdleTime it will be same as AlwaysStart and process is not used at that moment. If you use OnDemand with short IdleTime more often you will need CPU to start the process.

like image 78
Gjorgji Pop-Gjorgjiev Avatar answered Nov 28 '22 08:11

Gjorgji Pop-Gjorgjiev