Historically, using ETW is not very friendly. Existent tools are hard-to-use and the data generated is raw and mostly unprocessed. You can today generate ASP.NET traces using logman.exe and then use tracerpt.exe to generate a CSV file. This data is hard to look at it. Another option is to use FREB to generate traces. That log contains useful information, but sometimes is too much, especially if you just want to take a quick peek at a request or two. And ASP.NET events are only listed. The relation between the events is not used.
Currently, here are some issues associated with using ETW to measure ASP.NET performance:
1. Not user friendly.
2. Generates a lot of raw unprocessed data (for instance if generating a CSV file using logman.exe and tracerpt.exe).
3. FREB generates a file per each request. When browsing the log folder, it’s impossible to know which file belongs to which request. There is no summary that shows all requests traced.
4. Both methods just list the ASPNET events. They miss an important point. The information is not only in the fact that the event happened. An important piece of information is the duration between events. FREB shows duration for IIS event, but not for ASP.NET events. For instance, you can’t know how long your Page Load event took.
The tool that we are providing here will allow you to collect ETW traces for ASP.NET requests and look at them in a more friendly view. The tool doesn’t contain any executable. It just harnesses the functionality already in existence in Windows. In this case the data collector sets provided in the “Performance Monitor” (aka perfmon) in Vista or newer versions.
The tool is made out of three XML files. One file contains the data collector set definition (Perfecto.DataCollectorSet.xml). A second file (Reports.Microsoft.ASPNET.xml) contains the schema of the ASP.NET specific data included on ETW traces. A third xml file (Rules.Microsoft.ASPNET.xml) provides rules that will modify and rearrange the data so it’s easier to read and understand. Setup is very simple, just the XMLs and a setup.cmd script.
The tool can be used for purposes others than performance. For instance, you can see what modules are running in the pipeline. Or you can see what request are generating manage code to run.
We are considering adding this tool’s functionality to DebugDiag.
1. Download and unzip perfecto.zip.
2. Run setup.cmd. This script will:
a) Create a folder at “%programfiles%\perfecto” and copy there the three xml files listed before.
b) Create the data collector set:
logman.exe import "Service\ASPNET Perfecto" -xml Perfecto.DataCollectorSet.xml
c) Open “Performance Monitor” (perfmon).
1. On perfmon, navigate to the "Performance\Data Collector Sets\User Defined\ASPNET Perfecto" node.
2. Click the "Start the Data Collector Set" button on the tool bar.
3. Wait for/or make requests to the server (more than 10 seconds).
4. Click the "Stop the Data Collector Set" button on the tool bar.
5. Click the "View latest report" button on the tool bar or navigate to the last report at "Performance\Reports\User Defined\ASPNET Perfecto".
1. Only works on Vista or newer Os.
2. Requires IIS tracing: (run dism /online /enable-feature /featurename:IIS-HttpTracing).
3. Only ~140K of disk space is needed for the Xml files at "%programfiles%\perfecto".
Using the data collector set.
1. How to View the Performance Counters Graph: The report has three different views in perfmon data collector sets. You can right-click on the report, select "View", and "Performance Monitor" to see the graphic view of the performance counters collected.
2. How to Send Data by Email: Right-click on the report, select "View", and "Folder". Select the files you want to send, right click and select "Send To\Mail Recipient". You need to have email client properly configured.
3. How to Start/Stop Collection From Batch File:
logman.exe start -n "Service\ASPNET Perfecto"
logman.exe stop -n "Service\ASPNET Perfecto"
Note: The View commands are also available as toolbar buttons.
Sometimes you can see an error like below:
Error Code: 0xc0000bf8Error Message: At least one of the input binary log files contain fewer than two data samples.
This usually happens when you collected data too fast. The performance counters are set by default to collect every 10 seconds. So a fast start/stop sequence may end without enough counter data being collected. Always allow more than 10 seconds between a start and stop commands. Or otherwise delete the performance counters collector or change the sample interval.
Default sizes of the log files
One problem users usually have with ETW is that they can forget to turn off collection, so the ETL files can grow very big. To avoid this, we made the default in the data controller set to have a circular file: so older events are overwritten when the file grows beyond the default 5MB size. There is also a limit of 1GB for all files. This includes .etl, .blg and the reports XMLs.
These settings can be changed on the perfmon UI if you find they are not good for you:
1. To change maximum size of the log file, right click on the “ASPNET Perfecto” data collector set and chose properties. Select the "Stop Condition" tab.
2. To disable circular file, double click the AspnetTrace collector to open the properties and select the "File" tab.
3. To change the size of all log files, open the data manager in “Reports\User Defined\ASPNET Perfecto”. Right click for properties and change the “Maximum root path size:”.
ETW Performance Effect on Production Servers.
Enabling ETW events for the ASP.NET provider will make a hello world page around 38% slower, without impacting noticeable the memory usage. The effect on a web app such as IBuySpy is lower: around 11%.
Below is a table that shows and excerpt of how the report looks like:
Create App Domain
Enter App Domain: /LM/W3SVC/1/ROOT/app-1-129151551736866465
ASP.NET Execute Handler
Page Save Viewstate
Other performance related articles: http://blogs.msdn.com/josere
I was looking for it.
que significa error code 0xc0000bf8
Esto significa "Al menos uno the los coleccionadores the datos tiene menos de dos datos". Esto ocurre cuando los datos se coleccionan muy rapido. Los contadores de performance se leen cada 10 segundos, Si se presiona Start/Stop muy rapido, el sistema no tiene tiempo de leer mas de un dato. Para evitar esto, collecciona los datos por mas de 10 segundos. O borra el coleccionador de contadores. O cambia el intervalo de lectura.
Maria: What does error code 0xc0000bf8 means?
Jose: Means "At least one of the input binary log files contain fewer than two data samples". This usually happens when you collected data too fast. The performance counters are set by default to collect every 10 seconds. So a fast start/stop sequence may end without enough counter data being collected. Always allow more than 10 seconds between a start and stop commands. Or otherwise delete the performance counters collector or change the sample interval.
I am interested in this tool. Looks very impresive. I downloaded it but setup failed in Windows 7. Can you please confirm if it works on windows 7?
Thanks - Its a great help!
Yes. It works for me on Windows 7. What's the failure? Feel free to take it offline by sending me mail directly (See 'Email Blog Author' at the top of the page).
Hi dear Jose, I made some changes of this tool to add processor and network interface counts, and I done it by editing xml files provided in the package, could you tell me how to create a report from scratch out? Thanks a lot!
David, sorry it took me so long to reply to you. We’ve been busy around here.
Anyway, what I did to create my report was to add a new data collector set and export it as a template. The standard templates on the machine already come with many different report schemas. Looking at them, I reverse engineered how to create my own. The command below will find them on the hard drive:
findstr /si /c:"</Report>" c:\windows\*.xml
In any case, an empty report is just an xml like below:
<?xml version="1.0" encoding="UTF-8"?>
<?Copyright (c) Microsoft Corporation. All rights reserved.?>
Another option is to use the IDataCollectorSet COM Interface. See msdn.microsoft.com/.../aa371952(v=vs.85).aspx
Actually, the first version of perfecto used this API and C++ to create the collector. The sources are still somewhere. The problem with that version was that publishing to the web in executable format required the binaries to be signed. I avoided that but using XML only.
Hope that helps,
It would help to know how to interpret the counters themselves. Otherwise we are looking at a list of numbers. What is good? What screams out saying server is having problems? This is good but requires some more information.
Agreed. The goal here was just to present the tool.
This tool is impressive.
Can you please confirm if I can use this tool to monitor application as a whole?
I want to monitor total no. of requests coming, no. of requests completed, waiting, failed, avg. time taken for processing requests etc?
I have already set up Windows Perfo Monitor and added counters. But it's bar graph is not very user friendly. So, I am looking for other options and want to try Perfecto.
I would not recommend to use this tool, as it is, to monitor an application in production due to the impact in performance of enabling ETW. See "ETW Performance Effect on Production Servers" above.
You could disable the ETW portion of the collector and add/remove the performance counters you need.
I have this working but I don't get the Sub Steps that drill down from the ASP.NET Map Handler and ASP.NET Execute Handler events.