Is Stop server in IIS Manager the same as iisReset /stop? - iis-7

I notice when I click Stop server on IIS Manager, some w3wp.exe is still running. But I run iisReset /stop, they all exist.
I thought Stop server is the same as iisReset /stop, but apparently they are slightly different. What's the difference?

Related

IIS restarts suspended aplications after configuration change

I have encountered a (mis?)behavior of IIS/ASP.NET related to app pool suspension (Idle Worker Process Page-Out), and I can't find documentation about it. When an ASP.NET app (.NET Framework 4.8) in IIS (10.0) is suspended, and then a change is made to IIS configuration, the next time the app is accessed, it restarts (new AppDomain in same w3wp process).
It doesn't matter What is changed in IIS (appcmd add apppool, appcmd add app, etc.). Even touching applicationhost.config (changing LastWriteTime without content change) is enought to fire a restart. To be clear, the restart only happens if the app is SUSPENDED when IIS configuration is changed, and not if the app is live.
We have a lot of apps in the same IIS server, with frequent app deployments, and each time a deployment is made, all the suspended apps are affected (next user must wait the restart time). This renders useless the suspension mechanism. ¿Is this restart behavior by design or it's a bug? ¿Is there a way to prevent it?

Debugging kills Apppool

I have an application which worked fine until yesterday.
Today I cannot run the application using F5. I receive an error "Unable to start ASP.NET Debugging".
When this message appears, the app-pool is stopped. No matter how often I restart the app-pool, debugging stops it again.
I DID NOT change one line of code. But what I did was changing my windows-(domain-user)password.
I already rebooted.
Any clue? Any logfile where I might look at?
Is the application pool running as your domain account? Did you update the password in the application pool as well?
Have you checked the Event Viewer to see why the application pool isn't starting?

While Debugging IIS from VS2008 Website Is Unresponsive

I have a web app running in a local instance of IIS 7.5. My app pool has it Maximum Worker PROCESSES at 3. When I go to Vs2008 and attach my debugger to my local IIS I see three w3wp.exe processes as expected. I attach to all three. When I run a web page my breakpoint hits in my code behind, as expected.
Here's the problem: in my code behind my C# code is calling a service on another computer that in turn sends a request back to my local IIS box. This is all synchronous. The problem is that while I'm in the debugger it seems like that remote code's call to my IIS box is immediately failing. If I go on to that remote box while I'm debugging and try to pull up any URL from my local box it hangs. And, as soon as I hit F5 in VS2008 the browser frees up and fulfills the request.
So why does the VS2008 debugger cause IIS to not use any of the other worker processes to service other incomming requests?
Thanks for any ideas.
While you debugging any process - all the threads hangs.
So what you're describing is expected behavior. You're debugging a thread in IIS, the whole process hangs until you press F5 and return the control to the process.

Application Pools not starting after iisreset

Before I start, I know using iisreset is considered bad practice, but this shouldn't happen anyway..
What we have:
Several machines with IIS6 on Windows Server 2003 R2 (both 64 and 32 bits)
Several WCF webservices (.NET runtime 2.0) deployed in several applications, each with it's own application pool, each application pool running under an other windows account.
What happens:
All appPools are started, all services operational
IISReset is executed (or the machine is rebooted)
IIS comes back up, but not all application pools start properly. Sometimes they all come back up, sometimes one or more pools won't start. They can be started manually however.
Is this "normal" iis behavior and should I just avoid using iisreset, or are we doing something wrong in our .NET code?
The application pools should restart on an iisreset, but they do run outside of iis (in COM+) for reliability. This mean they may may not come back if the application is misbehaving, but IIS and the other apps will(should) come back. So yes, This is "normal".
P.S.
I would also like to "OUT" myself as a proud user of iisreset. Bad practice? Bah! ;D
IIS does not immediately start ASP.NET worker processes (w3wp.exe) until the first request comes in. When you say "not started", does it mean you attempt to access some WCF web services (after iisreset), and you get a Service Unavailable error because the appPool cannot be started? Do you see any IIS W3SVC related entries in the Event logs?
If there are, they may be able to clue you in why they cannot start; post them up here.
Reason:
IIS does not immediately start ASP.NET worker processes (w3wp.exe) until the first request comes in. When it says "not started" it mean you attempt to access some WCF web services (after iisreset) failed due to object was holding some space in memory, and you get a Service Unavailable error because the appPool cannot be started.
Workaround:
Create Batch file with following commands & schedule it.
net stop 23svc
net stop msftpsvc
net stop smtpsvc
net stop PleskControlPanel
net stop HTTPFilter
iisreset /restart
net start w3svc
net start msftpsvc
net start smtpsvc
net start PleskControlPanel
net Start HTTPFilter
Had similiar issue - after IIS has been restarted, DefaultAppPool was stopped.
In application event logs found an error:
Windows cannot log you on because your profile cannot be loaded. Check that you are connected to the network, or that your network is functioning correctly. If this problem persists, contact your network administrator.
DETAIL - Access is denied.
Fixed by setting in DefaultAppPool Advanced Settings option Load User Profile to False.
Hope it could be usefull.
In a prior support role, I managed several IIS servers running all kinds of .NET mess. When an AppPool failed to start, it was usually a bad login credential.
Re-setting the identity (auth credentials) via advanced settings of the Application pool worked for me.
Earlier I changed my active directory password and as the app pool was already running, it worked fine until I performed IISRESET.

What does 'IISReset' do?

On IIS 6, what does an IIS reset do?
Please compare to recycling an app pool and stopping and starting an ASP.NET web site.
If you replace a DLL or edit/replace the web.config on an ASP.NET web site is that the same as stopping and starting that web site?
IISReset stops and restarts the entire web server (including non-ASP.NET apps)
Recycling an app pool will only affect applications running in that app pool.
Editing the web.config in a web application only affects that web application (recycles just that app).
Editing the machine.config on the machine will recycle all app pools running.
IIS will monitor the /bin directory of your application. Whenever a change is detected in those dlls, it will recycle the app and re-load those new dlls. It also monitors the web.config & machine.config in the same way and performs the same action for the applicable apps.
IISReset restarts the entire webserver (including all associated sites). If you're just looking to reset a single ASP.NET website, you should just recycle that AppDomain.
The most common way to reset an ASP.NET website is to edit the web.config file, but you can also create an admin page with the following:
public partial class Recycle : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
HttpRuntime.UnloadAppDomain();
}
}
Here's a blog post I wrote with more info: Avoid IISRESET in ASP.NET Applications
It operates on the whole IIS process tree, as opposed to just your application pools.
C:\>iisreset /?
IISRESET.EXE (c) Microsoft Corp. 1998-1999
Usage:
iisreset [computername]
/RESTART Stop and then restart all Internet services.
/START Start all Internet services.
/STOP Stop all Internet services.
/REBOOT Reboot the computer.
/REBOOTONERROR Reboot the computer if an error occurs when starting,
stopping, or restarting Internet services.
/NOFORCE Do not forcefully terminate Internet services if
attempting to stop them gracefully fails.
/TIMEOUT:val Specify the timeout value ( in seconds ) to wait for
a successful stop of Internet services. On expiration
of this timeout the computer can be rebooted if
the /REBOOTONERROR parameter is specified.
The default value is 20s for restart, 60s for stop,
and 0s for reboot.
/STATUS Display the status of all Internet services.
/ENABLE Enable restarting of Internet Services
on the local system.
/DISABLE Disable restarting of Internet Services
on the local system.
Application Pool recycling restarts the w3wp.exe process for that application pool, hence it will only affect web sites running in that application pool.
IISReset restarts ALL w3wp.exe processes and any other IIS related service, i.e. the NNTP or FTP Service.
I think changing web.config or /bin does not recycle the whole application pool, but I'm not sure on that.
It stops and starts the services that IIS consists of.
You can think of it as closing the relevant program and starting it up again.
Editing the web.config file or updating a DLL in the bin folder just recycles the worker process for that application, not the whole pool.
IISReset restarts the entire webserver (including all associated sites). If you're just looking to reset a single ASP.NET website, you should just recycle that Application Domain.
When you change an ASP.NET website's configuration file, it restarts the application to reflect the changes...
When you do an IIS reset, that restarts all applications running on that IIS instance.
Here what's technet has to say about iisreset
You might need to restart Internet Information Services (IIS) before certain configuration changes take effect or when applications become unavailable. Restarting IIS is the same as first stopping IIS, and then starting it again, except it is accomplished with a single command.

Resources