.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Imran Ghani

Home >> Articles >> Azure >> Post New Resource Bookmark and Share   

 Subscribe to Articles

Windows Azure - Profiling : Azure Part 48

Posted By:Jean Paul       Posted Date: July 22, 2012    Points: 200    Category: Azure    URL: http://www.dotnetspark.com  

In the previous articles we have seen a way of logging information and publishing in Windows Azure.In this article we can experiment on Profiling.
 

Why we need Profiling?

Profiling is needed for performance measurement of an application. In the runtime we can see the real load on hardware:

  • CPU
  • Memory
  • Hard Disk etc.


For example, if the CPU load is 100% on 10 user requests, then we are sure that the application needed to be load balance when 100 user requests are expected. Otherwise the application performance will be reduced due to request processing delay.

In case of Azure application we can decide on adding more instances of web role or worker role based on performance information.

Pre-Requisites

This article requires knowledge of publishing azure applications using Visual Studio IDE. You can get the complete article here.

Steps

Please follow the steps to experiment Profiling for Windows Azure applications.

Step 1: Create a Worker Role

Create a new worker role and modify the Run() method as following.

public override void Run()
{
    // This is a sample worker implementation. Replace with your logic.
    Trace.WriteLine("$projectname$ entry point called", "Information");

    while (true)
    {
        List<string> list = new List<string>();

        for (int i = 1; i <= 1000; i++)
        {
            list.Add("Item" + i.ToString());
        }

        list.Sort();
    }
}


Step 2: Publish with Profiling

Now we need to publish the application to Windows Azure with Profiling enabled. Right click on the Azure project and choose the option Publish.



Select the subscription in the first page and click Next to continue. In the next page use Advanced Settings and select the Enable profiling option as shown below.



After entering the details click the Publish button. Wait for a few minutes for the deployment to be finished.



Step 3: View Profiling Report

For viewing the information, we can use the Server Explorer window in Visual Studio. From the Server Explorer window select Windows Azure Compute item. Right click on it and click on the Add Deployment Environment item.



In the appearing dialog select the environment to which the deployment was done.



Now select the View Profiling Report from the Server Explorer > Worker Role > Instance.





You can see a new item is queued in the Activity Log as shown below.



Once the Status is completed you can see the CPU Graph as shown below. In our example the CPU is clocking 100% utilization.



So this concludes the article on Profiling. We can profile more information like:

  • Instrumentation
  • .NET Memory Allocation
  • Concurrency


After the test please ensure to delete the deployment from the Azure platform.

Reference

http://msdn.microsoft.com/en-us/library/windowsazure/hh369930.aspx

Summary

In this article we have seen how to profile an application using Windows Azure. The attached source code contains the application we have discussed. 

 Subscribe to Articles

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend