How do I see currently executing web request on IIS 8 - iis-8

In IIS 7, I would click on "worker process" then "View Current Request" to see all the requests currently being executed.
http://technet.microsoft.com/en-us/library/cc732518(v=WS.10).aspx
In IIS 8, I do not see this option. Is there something I need to set up on IIS 8?
Edit: I tried running inetmgr as administrator as well.

There wasn't any UI hints, but was able to turn it on as a feature under server manager.
Server Manager -> Add Roles.
Web Server (IIS)
Web Server
Health and Diagnostics
Request Monitor

The required features can be installed with PowerShell.
IIS Manager:
Install-WindowsFeature Web-Mgmt-Tools
Request Monitor:
Install-WindowsFeature Web-Request-Monitor
With these features installed, run IIS Manager, browsing to the Worker Processes section shown in the screenshot below. From the list of Worker Processes, either double click on the process of interest to view currently executing requests or use the right-click context menu.
The back/forward arrows to the left of the address bar can be used to navigate back and forth between the list of requests and worker processes. The alt+left arrow / alt+right arrow keys perform the same actions.

I had to do this from an elevated command line
%windir%\system32\inetsrv\appcmd list requests
If you want to see requests exceeding more than 5 seconds
%windir%\system32\inetsrv\appcmd list requests /elapsed:5000
In a loop (assuming you are in %windir%\system32\inetsrv\
for /l %x in (,,) do (appcmd list requests /elapsed:5000 & timeout 2)

This show's the steps to install it. From https://portal.ektron.com/KB/10396/:
To run it after it's installed you will need to find the "Worker Process" icon on the server settings in IIS Manager.
Another good option with ASP.net is to go to task manager, right click on the process and select "Create Dump File" then download and double click on the created .dmp file to load it into Visual Studios debugger. Then look thru the threads and their call stacks to see where all the requests are being executed. This method allows you to see exactly what the requests are doing (infinite loops, deadlocks, etc.)

Related

Windows could not start the Apache CouchDB service on Local Computer

I have installed CouchDB on my Windows machine but while starting the CouchDB service, I am getting a message like:
Windows could not start the Apache CouchDB service on Local Computer. The service did not return an error. This could be an internal Windows error or an internal service error. If the problem persists, please contact your system administrator.
As the service is not running, I am unable to access Fauxton too.
I am using Windows 7. CouchDB is 2.0.0. Port 5984 is not in use.
I don't think your question is a duplicate of https://stackoverflow.com/a/44107335/219187 because you are on Windows 7, and the problem described there is for Windows 10 with the creators update.
But maybe the solution fixes your problem as well? Here is the procedure:
Download the prelease build 2.2.4-101 from https://nssm.cc/download
Stop the CouchDB service through the Windows Services dialog (paused is not enough)
Overwrite nssm.exe in <CouchDbInstallDir>\bin with the one from the downloaded ZIP file (make sure you pick the right version 32 bit / 64 bit)
Start the CouchDB service
Issue it's happening since the last updates released by Microsoft. I'm not completely aware of what's causing it, but I think it's something related to CouchDB service not been able to start using Local Administrator rights.
However I've managed to start the service manually, by doing so:
Open Command Prompt - in the Search from the Start Menu or Task Bar type "cmd"
Run it as an Administrator - right click on the Command Prompt application and choose "Run as administrator" option /this is really IMPORTANT as it will allow the service to have administrator access/
Navigate to the folder where CouchDB is install - default path is "D:/CouchDB", but could be anywhere else; you have to find it
Go to the "bin" folder in there
Type "couchdb" as a command to start the service
You will see a message showing after this - "kernel-poll not supported; "K" parameter ignored"
If it adds some error messages after it or closes the whole terminal, you're making some things bad from this guide, so follow it strictly.
You can now open up the Fauxton application in the browser like normal from here - http://localhost:5984/_utils/
Keep in mind that you have to leave the cmd opened in order the service to be working as expected. As far as I saw no information was lost, so it's all good.
This is a temporary solution though, as we are waiting a relase from either Microsoft or Apache to solve the issue, or at least give us more explanation about it.
i just met the same problem.
the cause is space, you have to install CouchDB in a path without any space, even Program Files folder, because there is a space between Program and Files...

Sql Server Reporting Services take long time to initialize configuration files before showing first report

I design GUIs for clients on window based servers. These systems are on very powerful Dell power edge servers. Inside the GUI, the client is able to open a web-browser that automatically opens the report selected. Clients access the GUI remotely, and log off in-between visits.
The first time a user logs in and tries to access a report, it takes as long as 45 seconds to open the report to view data. Every report after that loads in less than 5 seconds. I have done some research and found that the Sql Server needs to pull all the report server configuration files before it can show the first report, which takes a long time.
The config files are stored only for 12 hours by default, and the max you can set this is a couple days, I believe, inside the report services config file. This still requires the 45 second load time every other day or so.
I have tried pulling the configuration files as soon as a user remotes into the server, but that did not seem to work.
The server is running 24/7 and only turns off during a power outage. Is there a way to keep the report server configuration files on a system service or some way to never have to load the files again?
According to this article
The reason behind is that we have to wait for the application pool to
spin up. During each start up, the SSRS 2005 web service reads and
decrypts the rsreportserver.config file, it has to physically open up
a socket connection between the two servers since the connection pool
is empty, log into the database instance, etc. Also the web service
has to make RPC calls into the Windows Service to get the encryption
keys. There is an idle timeout value which forces the application to
shut down after 20 minutes by default. We can tweak this timeout
setting to have the application always up and running.
Solution SSRS 2005
First start Internet Information Services Manager from Control Panel
-> Administrative Tools. Navigate to your server instance on the left side pane and expand it. You will find the Application Pools. Right
click on it and choose the Properties option from the menu.
Choose the Performance tab in the Application Pool Properties window
and you will see that the default setting Idle Timeout is 20 minutes.
There are two ways to disable the idle timeout:
uncheck the checkbox in front of the setting or
set it to 0.
Solution SSRS 2008
For SQL Server 2008 you can make a modification to the "RecycleTime"
parameter in your report server config file. It will be located in the
following folder:
drive:\ Program Files\Microsoft SQL Server\MSRS10.MSSQLRS\Reporting
Services\ReportServer\rsreportserver.config
the value is in minutes.
Another possible solution
Here is a possible workaround solution. It rests on the scheduler and execution of a PowerShell script, which stops and starts the SSRS service (which has the same effect as the application domain restart) and after the restart it makes a request to the report manager URL which forces the reporting services to load all the configurations etc. Then all the subsequent request to SSRS are immediate.
Stop-Service "SQL Server Reporting Services (MSSQLSERVER)"
Start-Service "SQL Server Reporting Services (MSSQLSERVER)"
$wc = New-Object system.net.webClient
$cred = [System.Net.CredentialCache]::DefaultNetworkCredentials
$wc.Credentials = $cred
$src = $wc.DownloadString("http://localhost/Reports/Pages/Folder.aspx")
You can create a scheduled task using the Scheduled Tasks GUI or execute the below command to create the scheduled task from within a command prompt. The command prompt needs to be running with elevated administrative privileges.
schtasks /create /tn "SSRS Recycle" /ru UserName /rl highest /np /sc daily /sd 08/01/2011 /st 02:00 /tr "powershell.exe -noprofile -executionpolicy RemoteSigned -file c:scriptsSSRSRecycle.ps1"

Configuring WCF in IIS7 & Windows 7

I am having a problem when I try to browse WCF service (.svc file) which is hosted in IIS7 & Windows7. It throws following error.
HTTP Error 404.3 - Not Found
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.
I tried to run ServiceModelReg, but it say I should have admin rights in order to run this, although I am admin on this machine.
Does any one know how to resolve this issue.
FInally....
I am able to resolve this issue.
I ran following two command and it solved the problem.
aspnet_regiis -i & ServiceModelReg -i
Even though I am admin on the machine, I need to run this 2 commands by right click and select 'Run as Admin'.
Your issued is answered here. Trying to be short:
When you start the command prompt, can
you right-click on the icon to open it
and select "Run as Administrator"? I
don't know exactly what's the logic
behind that, but on Vista there are
two kinds of administrative users, one
"normal" administrator and one
"elevated" administrator. I'd guess
the tool needs the second kind.
and second
Also, Why do you need to run
Servicemodelreg.exe on VIsta?
Officially this is not supported on
Vista. Instead you can go to WIndows
features menu throught Add remove
programs and enabled Http Activation
under .Net framework 3.0 feature.
This will enable everything you might
want to do via Servicemodelreg.exe.
Edit
And also here.
If you go into IIS Manager and double click on Handler Mappings do you have *.svc paths listed?
If they are missing this link may help http://msdn.microsoft.com/en-us/library/ms752252(v=vs.90).aspx

Stop IIS 7 Application Pool from build script

How can I stop and then restart an IIS 7 application pool from an MSBuild script running inside TeamCity. I want to deploy our nightly builds to an IIS server for out testers to view.
I have tried using appcmd like so:
appcmd stop apppool /apppool.name:MYAPP-POOL
... but I have run into elevation issues in Windows 2008 that so far have stopped me from being able to run that command from my TeamCity build process because Windows 2008 requires elevation in order to run appcmd.
If I do not stop the application pool before I copy my files to the web server my MSBuild script is unable to copy the files to the server.
Has anybody else seen and solved this issue when deploying web sites to IIS from TeamCity?
This article describes using an htm file named App_offline.htm to take a site offline. Once the IIS detectes this file in the root of a web application directory,
ASP.NET 2.0 will shut-down the application, unload the application
domain from the server, and stop processing any new incoming requests
for that application.
In App_offline-htm, you can put a user-friendly message indicating that the site is currently under maintainance.
Jason Lee shows the MSDeploy calls you need to use (plus much more about integrating these steps in your build scripts!).
MSDeploy
-verb:sync
-source:contentPath="[absolute_path]App_offline-Template.htm"
-dest:contentPath="name_of_site/App_offline.htm",computerName="copmuter_name",
username=user_with_administrative priviliges,password=passwort
After deployment you can remove the App_offline.htm file using the following call:
MSDeploy
-verb:delete
-dest:contentPath="name_of_site/App_offline.htm",computerName="computer_name",
username=user_with_administrative_priviliges,password=passwort
The msbuild community tasks includes an AppPoolController that appears to do what you want (though as noted it is dated and at present only supports IIS6.) An example:
<AppPoolController ApplicationPoolName="MyAppPool" Action="Restart" />
Note that you can also provide a username and password if necessary.
Edit: Just noticed that the MSBuild Extension Pack has an Iis7AppPool task that is probably more appropriate.
this is the fairly hackey workaround I ended up using:
1) Set up a limited-access account for your service to run as. Since I'm running a CruiseControl.NET service, I'll call my user 'ccnet'. He does NOT have admin rights.
2) Make a new local user account, and assign to the Administrators group (I'll call him 'iis_helper' for this example). Give him some password, and set it to never expire.
3) Change iis_helper's access permissions to NOT allow local login or remote desktop login, and anything else you might want to do to lock down this account.
4) Log in (either locally or through remote desktop) as your non-admin user, 'ccnet' in this example.
5) Open a command terminal, and use the 'runas' command to execute whatever it is that needs to be run escalated. Use the /savecred option. Specify your new administrative user.
runas /savecred /user:MYMACHINE\iis_helper "C:\Windows\System32\inetsrv\appcmd.exe"
The first time it will prompt you for 'iis_helper's password. After that, it will be stored thanks to the /savecred option (this is why we're running it once from a real command prompt, so we can enter the password once).
6) Assuming that command executed OK, you can now log out. I then logged back in as a local admin and turned off the 'ccnet' user for local interactive login, and remote desktop. The account is only used to run a service, but no real logins. This isnt a mandatory step.
7) Set up your service to run as your user account ('ccnet').
8) Configure whatever service is running (CruiseControl.NET in my case) to execute the 'runas' command instead of 'appcmd.exe' directly, the same as before:
replace:
"C:\Windows\System32\inetsrv\appcmd.exe" start site "My Super Site"
with:
runas /savecred /user:MYMACHINE\iis_helper "\"C:\Windows\System32\inetsrv\appcmd.exe\" start site \"My Super Site\""
The thing to note there is that the command should be in one set of quotes, with all the inner quotes escaped (slash-quote).
9) Test, call it a day, hit the local pub.
Edit: I apparently did #9 in the wrong order and had a few too many before testing...
This method also doesn't completely work. It does attempt to run as the administrative account, however it still runs as a non-escalated process under the administrative user, so still no admin permissions. I didn't initially catch the failure because the 'runas' command spawns a separate cmd window then closes right away, so I wasn't seeing the failure output.
Its starting to seem like the only real possibility might be writing a windows service that will run as admin, and its only purpose is to run appcmd.exe, then somehow call that service to start/stop IIS.
Isn't it great how UAC is there to secure things, but in actuality just unsecures more servers, because anything you want to do you have to do as admin, so its easier to just always run everything as admin and forget it?
You can try changing the Build Agent Service settings to log-on as a normal user account instead of SYSTEM (the default), this can be done from the services control panel (Start | Run | services.msc).
If it doesn't help, you can also try configuring the appcmd to always run elevated, refer to this document for details.
In case such option is not available for appcmd or it still doesn't work, you can disable UAC completely for this user.
Here you go. You can use this from CC.NET with NAnt or just with NAnt:
http://nantcontrib.sourceforge.net/release/latest/help/tasks/iisapppool.html

How can I determine which w3wp.exe process belongs to which web site?

I have an IIS6 web server that is hosting two application pools. Occasionally, one of the w3wp processes will spike the CPU for a while, and both app pools seem to suffer the consequences. I'm not sure which one is which, and without that information I don't know which application to blame.
How can I tell which w3wp belongs to which App Pool?
For IIS7 you need to use APPCMD from %systemroot%\system32\inetsrv\ as an administrator
i.e.
%systemroot%\system32\inetsrv\appcmd list wp
See http://learn.iis.net/page.aspx/114/getting-started-with-appcmdexe/#HowToUse for more details
Goto cmd window then type c:\windows\system32\cscript c:\windows\system32\iisapp.vbs.
Now you will get the list of worker processes along with the app pool name.
lisapp.vbs from microsoft is for exactly that.
There are two ways in which I prefer "task manager" version.
By task manager,
Add "command line" column as shown in the images.
By PowerShell,
cd C:\Windows\System32\inetsrv\
.\appcmd list wp
You can also use Process Explorer from Sysinternals. Right click the columns at the top and select the "Command Line" column. In the Command Line column you will see the name of the web app included in the full command.
You can also get this information from the IIS Debug Diagnostic Tool