1

In IIS, I have the option to change the periodic restart settings which control when the app pool recycles. Most of the attributes make sense to me (memory, private memory, time) except one: "requests". The Microsoft documentation states that the "request" attribute:

"Specifies that the worker process should be recycled after it processes a specific number of requests. The default value is 0, which disables the attribute."

My question is: since the default value allows unlimited requests (which makes sense to me), then why would it be advantageous for a production app to limit these requests? An app pool recycles would lose the session data for the app, which seems a bit silly to do just because many requests have gone by. Is limiting the number of server request something that would protect against DDOS attacks or some other concern that I'm overlooking? Why would anyone want to have the app pool recycle just because the application is being used?

documentation: https://learn.microsoft.com/en-us/iis/configuration/system.applicationhost/applicationpools/add/recycling/periodicrestart/index

Goku
  • 1,565
  • 1
  • 29
  • 62
  • Stack Overflow is not an education site, but specific questions. A server won't be able to handle unlimited requests based on its hardware and software, so you should always set a reasonable limit and then plan the capacity. Too broad a question, and you should refer to specific books or tutorials. – Lex Li Feb 17 '18 at 02:02
  • 1
    @LexLi If you read my question more carefully (or had a better understanding of IIS) the hardware shouldn't matter because iis isn't referring to request/time, but requests total before a recycle event takes place. As to tutorials, this is not something that is covered in them because it is TOO specific. If you would like references I can show you numerous popular questions that asked something broad like "why would an interface be used instead of a parent class"; that sounds pretty educational to me. Stack overflow is about education and not simply doing people's programming homework for them – Goku Feb 18 '18 at 02:48
  • Let me simply down vote this question to reflect that you did not make it clear enough. Application pool has at least two settings on request numbers, `queueLength` in https://learn.microsoft.com/en-us/iis/configuration/system.applicationhost/applicationpools/add/ and `requests` in https://learn.microsoft.com/en-us/iis/configuration/system.applicationhost/applicationpools/add/recycling/periodicrestart/index . You should try to revise the question to tell which setting you are referring to. – Lex Li Feb 18 '18 at 02:54
  • @LexLi Well assuming you are downvoting because my question is actually bad, then I have no problem with that. But, assuming you are actually trying to help: what would be a better way to ask my question? I'm not completely sure what makes my question too vague, and why I can't ask a question that educates me. I rewrote my question based on your suggestion; constructive criticism is appreciated. – Goku Feb 18 '18 at 03:19
  • 1
    Checked your update. Look better but still too broad for an answer. Once you split it to smaller ones, you should find tons of existing threads, like https://stackoverflow.com/questions/7171367/why-do-iis-application-pools-need-to-be-recycled and https://stackoverflow.com/questions/133236/asp-net-session/133411#133411 What you say the design "seems to be a bit silly", you just read too little about the related topics. – Lex Li Feb 18 '18 at 14:16
  • @LexLi I think your links answer my questions. Basically, it is dangerous to not recycle your application, so some limits need to be set. Do you think I should delete this question, I know it is broad, but maybe someone could use it? If you want to answer it with your comment, then I can just accept the answer – Goku Feb 20 '18 at 16:05

1 Answers1

1

Keep in mind that, some of the reasons for recycling a w3wp.exe processing in IIS usually is to avoid unstable states due to memory leaks, db connection leaks, wcf handle leaks, iis request hung, or some other unreleased undisposed resource because of poor programming or bad code. So you don't want those resource leaks to accumulate over time.

The "Request Limit" is an alternative to the "Regular Time Interval" because there are instances where you know approximately how often your code leaks resources per number of request. For example in Production, I may have a particular pattern of traffic such as 1,000,000 request per hour, after which I know there are 1Gig of memory leak. So "Request Limit" is simply an alternative if you know very specific information about your own application. Whereas a "Time Interval" setting, may accumulate 1,000,000 request or 10,000,000 request in that time interval resulting in a vastly worst resource Leak that may crash the w3wp.exe process. So given the information you know, you would choose to use a static number "Request Limit", instead of a timed interval.

enter image description here

CodeCowboyOrg
  • 2,983
  • 1
  • 15
  • 12