Profiling a Windows Azure Application
You can profile your Windows Azure application when it runs in Windows Azure to determine any performance issues. When you publish your Windows Azure application from Visual Studio, you can choose to profile the application and select the profiling settings that you require. A profiling session is started for each instance of a role. For more information about how to publish your application from Visual Studio, see Publishing Applications to Windows Azure from Visual Studio.
To understand more about performance profiling in Visual Studio, see Beginners Guide to Performance Profiling and Analyzing Application Performance by Using Profiling Tools.
Important |
|---|
You can enable either IntelliTrace or profiling when you publish your Windows Azure application. You cannot enable both. |
There are different collection methods for profiling that you can decide to use, based on your performance issues:
CPU sampling
This method collects application statistics that are useful for initial analysis of CPU utilization issues. CPU sampling is the suggested method for starting most performance investigations. There is a low impact on the application that you are profiling when you collect CPU sampling data.
Instrumentation
This method collects detailed timing data that is useful for focused analysis and for analyzing input/output performance issues. The instrumentation method records each entry, exit, and function call of the functions in a module during a profiling run. This method is useful for gathering detailed timing information about a section of your code and for understanding the impact of input and output operations on application performance. This method is disabled for a computer running a 32-bit operating system.
.Net Memory Allocation
This method collects .NET Framework memory allocation data by using the sampling profiling method. The collected data includes the number and size of allocated objects.
Concurrency
This method collects resource contention data, and process and thread execution data that is useful in analyzing multi-threaded and multi-process applications. The concurrency method collects data for each event that blocks execution of your code, such as when a thread waits for locked access to an application resource to be freed. This method is useful for analyzing multi-threaded applications.
You can also enable Tier Interaction Profiling, which provides additional information about the execution times of synchronous ADO.NET calls in functions of multi-tiered applications that communicate with one or more databases. You can collect tier interaction data with any of the profiling methods. For more information about tier interaction profiling, see Tier Interactions View.
The following illustration shows how to configure your profiling settings from the Publish Windows Azure Application dialog box.
Important
|
|---|
|
To enable the Enable profiling check box, you must have the profiler installed on the local computer that you are using to publish your application. By default, the profiler is installed if you have either of the following SKUs installed: Visual Studio Ultimate or Visual Studio Premium. |
To configure profiling settings
-
In Solution Explorer open the shortcut menu for your Windows Azure project and then choose Publish.
For detailed steps about how to publish a Windows Azure application, see Publishing a Windows Azure Application using the Windows Azure Tools.
-
To enable profiling, select the Enable profiling check box.
The Settings hyperlink is enabled.
-
To configure your profiling settings, choose the Settings hyperlink.
The Profiling Settings dialog box is displayed.
-
In the What method of profiling would you like to use radio buttons, choose the type of profiling that you need.
-
To collect the tier interaction profiling data, select the Enable Tier Interaction Profiling check box.
-
To save the settings, choose the OK button.
When you publish this application, these settings are used to create the profiling session for each role.
A profiling session is created for each instance of a role in your Windows Azure application. To view your profiling reports of each session from Visual Studio, you can view the Server Explorer window and then choose the Windows Azure Compute node to select an instance of a role. You can then view the profiling report as shown in the following illustration.
Important
|
|---|
|
You must have Visual Studio Ultimate or Visual Studio Premium installed on the computer that you use to be able to view profiling reports for your Windows Azure application. |
To view profiling reports
-
To view the Server Explorer window in Visual Studio, on the menu bar choose View, Server Explorer.
-
Choose the Windows Azure Compute node and then choose the Windows Azure deployment node for the Windows Azure application that you selected to profile when you published from Visual Studio.
-
To view profiling reports for an instance, choose the role in the application, then open the shortcut menu for a specific instance and choose View Profiling Report.
The report, a .vsp file, is now downloaded from Windows Azure and the status of the download is displayed in the Windows Azure Activity Log. When the download completes, the profiling report is displayed in a tab in the editor for Visual Studio named <Role name>_<Instance Number>_<identifier>.vsp. Summary data for the report is displayed.
-
To display different views of the report, in the Current View list choose the type of view that you want to see. For more information about profiling reports, see Profiling Tools Report Views.
Important