W3WP#N Mapping To _LMW3SVC_#_ROOT (Perfmon Counters) - iis

We do have multiple sites hosted on same server with multiple appdomain. I am trying to read perfmon for specific site "Request/Sec" (Any many other). What I encountered is name of instance is not user friendly in Perfmon Monitor. Is there any mapping between W3WP to LM_W3SVC_#_ROOT (Please see screenshot for more details). I tried appcmd, looked into several blogs but no luck. So was wondering if someone knows more about it than it would be really helpful.
Update:
Does it come from C:\Windows\System32\inetsrv\config\applicationHost.config? If yes is there any way to give it better name in perfmon monitor? If no than still my original question exist :)

In _LM_W3SVC_N_ROOT, the N is the site id in IIS. You can easily find this by opening IIS Manager (Internet Information Services (IIS) Manager). Expand the computer and then sites. To the right of each site, you'll see an ID value.
For w3wp#N, it's a bit harder to track this down. The first w3wp instance to run is called "w3wp". Every other instance will be "w3wp#N". The N in this case IS NOT the N from above. It is simply a sequential number. There is a counter called \Process\ID Process. That will identify the process id of the "w3wp#N"instance you're looking at.
You'll then need to either:
run: c:\Windows\system32\inetsrv\appcmd list wp
Open IIS Manager, click on the computer name, on the left, and open "Worker Processes"
Both methods will list out the IIS site and it's associated w3wp.exe process ID.

Related

How to analyze file access rights issues in IIS?

I am trying to set up a web application to work in IIS.
Among other things, I have created an "application" node pointing to my directory with binaries.
That application node uses pass-through-authentication, and it uses an AppPool for which my current user is set as the identity.
For some reason, IIS thinks it cannot access those files, as evidenced by the "Test Connection" output:
The user name + password combination is definitely correct, as IIS checks the validity of the credentials already upon input.
Note that this is by far not the first time this is happening: I have set up this web application on many, many machines already over the past five years, and yet, every single time a new developer joins the team, or we have to set up a new machine, we keep struggling with these access rights issues for multiple hours, or even days.
In the end (just like I have started in this case), all kinds of users (<machine name>\User, <machine name>\Benutzer, "Everyone", authenticated users, administrators, anonymous user, IIS_IUSRS, ...) have been granted full access to all files on the disk. Usually, at some point (after so much trying, configuring, switching forth and back, that no-one knows what actually solved the issue), the problem is gone.
What is a more systematic and minimal approach to troubleshooting (or, better yet, avoid) this issue when setting up a web application in IIS?
For file access issues, use Process Monitor will be fine.
Set the filter as "Process Name is w3wp.exe" "Result is not SUCCESS"
Add "user" column. Then you can check at which step, user access files unsuccessfully.

Azure B1Is nonfunctional upon creation

I have an almost static site that i was happy hosting on Storage blob. However, i need to have php script run to support email communication through the contact html form.
So i decided to buy the smallest VM which is B1Is which has 1 CPU and 0.5 GB of memory. I RDP to the server and to my astonishment I cannot even open one file or folder or Task Manager without waiting endlessly before the "Out of memory ...please try to close programs or restart all"!
The Azure team should not sell such a VM if it will be nonfunctional from the get go. Note that i installed ZERO programs on it.
All i want is php and setup the site on IIS. And add a certificate license to it. NO Database or any other programs will run.
What should i do?
Apparently it is because "1 B1ls is supported only on Linux" based on the notes on their page.
https://learn.microsoft.com/en-us/azure/virtual-machines/windows/sizes-general

Why is Azure Scale-Out Crashing the Web App

I'm currently running Umbraco on a web app for Microsoft Azure. Anytime I enable scaling out and the web app starts scaling out, I get the error:
"Process cannot access the file, Examine Indexes write.lock because it is being used by another file.
The website then needs to be restarted before it becomes fully functioning again. Is there a setting on Umbraco that I'm missing?
Or is it something that happens with Azure Web Apps Auto Scaling features?
This sounds like an issue with the indexes. Your index appears to be getting locked when scaling out. Ideally if you're running on a load balanced environment, you should have a single index for all environments instead of on a per instance basis. I've used Azure Search in the past and it's worked perfectly, swapping out the index isn't too difficult with Umbraco, plenty of information available online. Good example here
In the future you shouldn't need to restart the entire site, rebuilding the indexes should be fine.
Also, what version of Umbraco are you running? This may be of some help, I encountered some similar issues a few months ago - unrelated to scaling though.
https://issues.umbraco.org/issue/U4-10735
Sounds like you need to isolate your index files so they aren’t shared across the difference instances and don’t lock each other out. There’s a few ways to do this based on the version you are running, but in 7.3, i think you update the index file location to include the instance name like ~/App_Data/TEMP/ExamineIndexes/{machinename}/Internal/
For more details, see https://our.umbraco.com/documentation/getting-started/setup/server-setup/load-balancing/flexible#if-you-plan-on-using-auto-scaling

When should an Azure website be restarted, and what are the consequences?

In the Azure Management Portal, you can configure your website. As an example, you can change the PHP version your website is using. When you have edited a configuration option, you have to click “Save”.
So far, so good. But you also have the option to restart your site (by clicking “Restart“ next to “Save”).
My question is, when should you restart your website? Are there some configuration changes that require a restart, and others that don't? I haven't found any hints in the user interface.
Are there other situations that require a restart? Say, the website has been running for a given time without a restart?
Also, what are the consequences of restarting a website? Does it affect cookies/sessions in any way (i.e. delete a user's shopping cart or log them out)? Are there any other consequences I should be aware of?
Generally speaking, you may want to restart your website because of application performance issues. For example, you may have a memory leak in your application, connections not getting closed, or other things that would degrade the performance of the application over time. As you monitor your website and observe conditions like this you may make a decision to restart it. Even better, you may even automate the task of restarting when these conditions occurr. Anyway, these kinds of things are not unique to Azure Websites. You would take similar actions for a website running on-premises.
As for configuration changes, if you make a change to your web.config file, this change is detected and your website would be restarted automatically for you. Similarily, if you were to make configuration changes in the CONFIG page of your website in the Azure Management Portal such as application settings, connection strings, etc., then Azure Websites will detect this change to your environment and automatically restart it.
Indeed, restarting a website will result in any session data kept in memory being lost for that instance. Additionally, if you have startup/initialization code that takes time to complete then that will have to be rerun. Again, this is not anything unique to Azure Websites though.

Role Instances are taking longer than expected - Workaround issues

Whenever we get the error "Role Instances are taking longer than expected". The only possible options to do are .
Shutdown the emulators and try again.
Restart the machine and see if that helps.
Uninstall the Azure Tools for that version.
Some times uninstalling the same takes a long time,some times even days. It appears that some process or service is blocking the same. Has anyone faced this before ? If yes does anyone know which process would be blocking the same?
When an instance starts it will run the OnStart method on the worker/web role (depending on your service type). The more stuff you have in there, the more time it will take to start up the role. Common caveats are the Cache as mentioned and blob/table storage (if you do read/write/create when you start the role).
Try minimizing the OnStart's workload and moving any storage stuff in async tasks.
I have had similar problems as well in the past
IISConfigurator could not map the web roles in IIS. In my case it was due to corrupted file system ACLs on the code directory. See logs under C:\Users\YOUR_USER_NAME\AppData\Local\dftmp\IISConfiguratorLogs\
Another cause might be that something else has tied up the Port Numbers that Azure is trying to bind your web role on. Or that the ports that the local storage needs for tables/blobs and queues (10000-10002) have been taken by another app. Open a command prompt and run netstat -anb
Try running the Visual Studio using "Run as Administrator" option.

Resources