views:

1410

answers:

3

Hello everyone,

I am using IIS 6.0 on Windows Server 2003. I want to learn what means recycle after "Fixed number of requests" in application pool setting? My current confusion is, suppose I set this number to 100, and the 99th person connects to my web site, than the 100th person comes and the 100th person will trigger application pool recycle rule of 100th requests, which means all session information for the 99th person will be lost (in-process session will expire when application pool worker process restarts)?

thanks in advance, George

+2  A: 

You basically have it right, but it's not the person, it's the request. Each aspx page called on your application will add up and when the threshold is reached, the application pool is recycled, the application domain (if your using .Net) is unloaded and everything starts up again. You lose Session, Application and any static variables laying around. If your using classic asp or php, every session and global variables are lost too.

A number of hits threshold is a bit overkill. You should either disable it or set it to a huge number. By default, if I recall well, the IIS6 application pool recycles every 15 minutes if there were no request and you can also put threshold on the total memory used by your application to trigger recycling.

Yann Schwartz
A further question, we could also set IIS worker process recycle at specific time, does it mean (1) at specific time IIS will recycle or it means (2) at specific time if no user is accessing IIS (no active connections), worker process will recycle?
George2
+2  A: 

That is quite correct. If you do not use some kind of Session farm, or database backing of the session information, it will be lost when the application pool is recycled. I would recommend trying hard to not require any session information - this will make your application more scalable and reliable as it maps more closely to the stateless nature of the underlying HTTP.

1800 INFORMATION
A further question, we could also set IIS worker process recycle at specific time, does it mean (1) at specific time IIS will recycle or it means (2) at specific time if no user is accessing IIS (no active connections), worker process will recycle?
George2
IIS will recycle at that time - the application pool will flush all outstanding requests, accepting no new ones, and the stop. A new instance will be started at the same time to handle new requests
1800 INFORMATION
Means the same effect -- existing in-process session will be destroyed?
George2
Exactly. Session state is kind of an evil thing since it requires to map across server restarts and server farms and all that other stuff
1800 INFORMATION
@1800 INFORMATION, 1. I think recycle at fixed time or at specific number of requests are very dangerous settings, why people need that? 2. If we disable recycle at specific time and also disable at recycle at specific number of requests handled, are there are side-effects?
George2
Normally people set those to mitigate the effects of issues such as unbounded memory usage, hangs or crashes due to bugs - if the issue cannot be resolved, or the root cause has not been determined, then setting this can increase reliability in a live environment by recycling the application pool before the bad effects would become apparent. If you have no issues such as this, then you don't need to set the recycling
1800 INFORMATION
A: 

What is the best recycle setting for IIS on development box? Thanks Ray Akkanson

Ray akkanson
Ray, on StackOverflow you should ask a question as a new question, not as an answer to another question. You would also want to think about providing more detail with this question, because as you've written it, it's unanswerable.
Will Dean