Search code examples
asp.netiis-7bandwidth-throttling

IIS7 and ASP.NET how to throttle user requests


I am using ASP.NET with IIS7 and today a bug in one of my pages caused the server to go down. The script was using ajax to query a resource at a rate of ~1000 requests per second. The requests are authenticated, so I know what user requested what page.

My question is, either via IHttpModule or otherwise, how do I limit at the server-level, the max number of requests per second (or per minute) a client is allowed to make and then introduce a delay so that their requests are throttled?


Solution

  • Open you IIS manager and select application pool signed to your asp.net application. Open advanced Settings for this pool and set Request Limit that shuold be greather than 0.

    enter image description here