70

In IIS7, there are numerous things you can do that seem to restart the website. I am unclear about exactly how they are all related.

  • run iisreset from the command line
  • refresh a website
  • recycle an app pool
  • restart a website

Can someone explain exactly what each one does please?

4 Answers 4

77

iisreset will stop and start the World Wide Web Publishing Service. This, of course, applies to all of your application pools. I'm sure you noticed a process being created for each application pool. This process will handle requests for all websites associated with it. When you recycle an application pool, IIS will create a new process (keeping the old one) to serve requests. Then it tries to move all requests on the new process. After a timeout the old process will be killed automatically. You usually recycle your application pool to get rid of leaked memory (you might have a problem in your application if this needs to be a regular operation, even though it is recommended to have a scheduled recycle). As for restarting a website, it just stops and restarts serving requests for that particular website. It will continue to serve other websites on the same app pool with no interruptions.

If you have a session oriented application, all of the above will cause loss of session objects.

Refreshing a website has no effect on the service/process/website and is merely a UI command to refresh the treeview (maybe you added a directory you don't see in the management console).

5
  • 2
    Do you have a source for this information? Aug 18, 2015 at 14:03
  • 1
    @JoshuaDrake this is a very nice article explaining iisreset vs app pool recycle fullsocrates.wordpress.com/2012/07/25/… Mar 3, 2016 at 23:12
  • if I have a website with an app pool, and multiple Application folders with their own app pools, will restarting the website restart all the app pools?
    – sonjz
    Sep 30, 2016 at 4:01
  • One application pool can be used for multiple websites? Or is it one to one? Dec 5, 2016 at 18:43
  • Can you add a link to official documentation for iisreset? Thanks in advance. Feb 27, 2020 at 20:45
6

To answer your two other questions:

  • Refresh a websites just reloads data from the server
  • Restart a website doesn't do much really. By stopping the web site, it will no longer listen for requests on any of it's bindings. Starting it again makes it start listening again. Processes serving the web site remain unaffected.
4

iisreset stops and starts the whole webserver. That's everything - all your users lose their connections while this is happening.

Recycling an application pool stops and started the processes associated with the application(s) that are in that pool. Strictly speaking, it doesn't have anything to do with the website (except for the active content from those applications.)

4
  • 1
    What about refresh and restart? Mar 15, 2011 at 3:06
  • 1
    Dunno, I haven't used IIS 7 much, and don't even have IIS 6 in front of me. What does Help say that they do?
    – mfinni
    Mar 15, 2011 at 3:25
  • Can you add a link to official documentation for iisreset? Feb 27, 2020 at 20:46
  • @PeterMortensen, if I'd put a link here back in 2011, it would be a dead link now.
    – mfinni
    Feb 28, 2020 at 4:52
4

@Vlad Mucescu gave a good answer but it seem the part where he describes recycle of an application he speaks about Overlapped Recycling. There are two recycling types: Process Recycling and Overlapped Recycling (source MSDN):

Process Recycling

Worker process isolation mode offers process recycling, in which IIS automatically refreshes Web applications by restarting their worker processes. Process recycling keeps problematic applications running smoothly, and is an especially effective solution in cases where it is not possible to modify the application code.
Process recycling, which follows the occurrence of a recycling event, can happen in two ways.
If the worker process currently serving the application pool terminates, then the WWW Service (W3SVC), acting as the parent process to the worker processes, restarts a new process in its place.
When the worker process terminates, a new one is started simultaneously. This type of recycling is called overlapped recycling. It is the default for all application pools.

Overlapped Recycling

In an overlapped recycling scenario, the process targeted for a recycle continues to process all remaining requests while a replacement worker process is created simultaneously. The new process is started before the old worker process stops, and requests are then directed to the new process. This design prevents delays in service, since the old process continues to accept requests until the new process has initialized successfully, and is instructed to shut down only after the new process is ready to handle requests.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .