Eksportuj (0) Drukuj
Rozwiń wszystko
EN
Ta zawartość nie jest dostępna w wymaganym języku. Wersja w języku angielskim znajduje się tutaj.

Create and Use Performance Counters in an Azure Application

Updated: August 18, 2014

Just as with Windows Server, you can use performance counters in a Azure application to collect data that can help determine system bottlenecks and fine-tune system and application performance. Web roles, worker roles, and VM roles can dynamically configure performance counters collected by the Azure diagnostic monitor, and create and use custom performance counters for application-specific monitoring and management. Performance counter data can be examined directly on the application host with the Performance Monitor tool accessed using Remote Desktop, with System Center Operations Manager using the Windows Azure Management Pack, or with other monitoring tools that access the diagnostic data transferred to Azure storage. See Store and View Diagnostic Data in Azure Storage for more information. For information on configuring performance counters in your application, see How to Configure Performance Counters.

Performance counters are not enabled by default in the diagnostic monitor. Your application or a startup task must modify the default diagnostic monitor configuration to include the specific performance counters that you wish to monitor for each role instance if you need performance counter data.

Azure provides a subset of the performance counters available for Windows Server 2008, IIS and the ASP.NET stack. The following table lists some of the performance counters of particular interest for Azure applications.

 

Counter Category: Object (Instance) Counter Name Reference

.NET CLR Exceptions(_Global_)

# Exceps Thrown / sec

Exception Performance Counters

.NET CLR Memory(_Global_)

% Time in GC

Memory Performance Counters

ASP.NET

Application Restarts

Performance Counters for ASP.NET

ASP.NET

Request Execution Time

Performance Counters for ASP.NET

ASP.NET

Requests Disconnected

Performance Counters for ASP.NET

ASP.NET

Worker Process Restarts

Performance Counters for ASP.NET

ASP.NET Applications(__Total__)

Requests Total

Performance Counters for ASP.NET

ASP.NET Applications(__Total__)

Requests/Sec

Performance Counters for ASP.NET

ASP.NET v4.0.30319

Request Execution Time

Performance Counters for ASP.NET

ASP.NET v4.0.30319

Request Wait Time

Performance Counters for ASP.NET

ASP.NET v4.0.30319

Requests Current

Performance Counters for ASP.NET

ASP.NET v4.0.30319

Requests Queued

Performance Counters for ASP.NET

ASP.NET v4.0.30319

Requests Rejected

Performance Counters for ASP.NET

Memory

Available MBytes

Memory Performance Counters

Memory

Committed Bytes

Memory Performance Counters

Processor(_Total)

% Processor Time

Performance Counters for ASP.NET

TCPv4

Connection Failures

TCP Object

TCPv4

Connections Established

TCP Object

TCPv4

Connections Reset

TCP Object

TCPv4

Segments Sent/sec

TCP Object

Network Interface(*)

Bytes Received/sec

Network Interface Object

Network Interface(*)

Bytes Sent/sec

Network Interface Object

Network Interface(Microsoft Virtual Machine Bus Network Adapter _2)

Bytes Received/sec

Network Interface Object

Network Interface(Microsoft Virtual Machine Bus Network Adapter _2)

Bytes Sent/sec

Network Interface Object

Network Interface(Microsoft Virtual Machine Bus Network Adapter _2)

Bytes Total/sec

Network Interface Object

Azure has support for custom performance counter creation and modification for web roles and worker roles. Custom performance counters may be used to track and monitor application-specific behavior. Custom performance counter categories and counter specifiers can be created or deleted in a startup task, web role, or worker role with elevated permissions.

noteNote
Code that makes changes to custom performance counters must have elevated permissions to run. If the code is in a web role or worker role, the role must include the tag <Runtime executionContext="elevated" /> in the ServiceDefinition.csdef file for the role to initialize properly.

Custom performance counters may be enabled and have their data transferred to Azure storage with standard performance counters using the diagnostic monitor.

The standard performance counter data is generated by the Azure processes. Custom performance counter data must be created by your web role or worker role application. See Performance Counter Types for information on the types of data that can be stored in custom performance counters. See PerformanceCounters Sample for an example that creates and sets custom performance counter data in a web role.

Performance counter data is cached in Azure with other diagnostic information. This data is available for remote monitoring while the role instance is running using remote desktop access to view tools such as Performance Monitor. To persist the data outside of the role instance, the diagnostic monitor must transfer the data to Azure storage. The size limit of the cached performance counter data can be configured in the diagnostic monitor, or it may be configured to be part of a shared limit for all the diagnostic data. For more information about setting the buffer size, see OverallQuotaInMB and DirectoriesBufferConfiguration. See Store and View Diagnostic Data in Azure Storage for an overview of setting up the diagnostic monitor to transfer data to a storage account.

Each configured performance counter instance is recorded at a specified sampling rate, and the sampled data is transferred to the storage account either by a scheduled transfer request or an on-demand transfer request. Automatic transfers may be scheduled as often as once per minute. Performance counter data transferred by the diagnostic monitor is stored in a table, WADPerformanceCountersTable, in the storage account. This table may be accessed and queried with standard Azure storage API methods. See Windows Azure PerformanceCounters Sample for an example of querying and displaying performance counter data from the WADPerformanceCountersTable table.

noteNote
Depending on the diagnostic monitor transfer frequency and queue latency, the most recent performance counter data in the storage account may be several minutes out of date.

See Also

Pokaż:
© 2014 Microsoft