We have a busy webserver handling around 1000 asp.net requests/second.

We have a deploy script which copies compiled asp.net from our development box.

The script first stops IIS on the production server, copies the code, then restarts.

We use the following command to stop the app pool for the site:

%windir%\system32\inetsrv\appcmd stop apppool /apppool.name:ourappname

The problem is that this stops accepting new requests but waits for existing requests to complete. There are usually a handful of requests that take up to a minute to finish, during which time no new requests are served. So for the sake of fulfilling a dozen or so requests, we miss out on serving the 1000 * 60 = 60,000 requests that have come in during the minute or so while we're waiting for 12-20 to complete. This is dumb.

What we would LOVE to do is force an app pool stop within x seconds. This doesn't seem to be possible. Is there a better way to accomplish what we're doing i.e. fast stop of iis 7?


Why do you need to stop and restart the app pool? Updating files in the bin directory will cause the app pool to restart at the relevant points. Once you've completed the deploy saving a change to the web.config file would cause a restart of the app pool if you've not updated anything in bin.

If you do need to bring it down then you can do that at the IIS level (the w3wp service).

net stop w3wp
net start w3wp

Not the answer you're looking for? Browse other questions tagged or ask your own question.