Exportera (0) Skriv ut
Visa allt
EN
Det här innehållet finns inte tillgängligt på ditt språk men här finns den engelska versionen,

In-Role Cache Troubleshooting and Diagnostics (Azure Cache)

Updated: September 24, 2014

noteNote
For guidance on choosing the right Azure Cache offering for your application, see Which Azure Cache offering is right for me?.

In-Role Cache applications are configured for diagnostic data collection using a diagnostic level. This diagnostic level provides a single setting for configuring the level of data collection. This topic provides an overview of troubleshooting steps and diagnostics for troubleshooting In-Role Cache applications.

Troubleshooting and Diagnostics for In-Role Cache Applications

Applications running on Azure are widely distributed, multi-instance applications that can be hard to debug. These types of applications require more than standard tools and approaches to troubleshooting. Troubleshooting Azure applications is beyond the scope of this topic, but more information is available in Troubleshooting in Azure and Diagnostics and Debugging in Azure. These topics discuss proven troubleshooting practices and contain links to more intensive information and best practices. For more information about viewing diagnostic data once it is collected, see Store and View Diagnostic Data in Azure Storage.

Configuring In-Role Cache applications to collect diagnostic data for troubleshooting requires configuring the diagnostic level and configuring the cache diagnostics during role startup. This topic provides an overview of these steps for troubleshooting In-Role Cache applications.

Configure the Diagnostic Level

In-Role Cache provides five diagnostic levels which are used to configure the amount of diagnostic data collection. Diagnostic levels range from 0 to 4, and the number indicates the volume of diagnostic information collected for cache servers and clients. Each diagnostic level contains a pre-configured set of performance counters, event logs, tracing, and crash dump settings that can be used to monitor the health of your In-Role Cache application.

 

Diagnostic Level Diagnostic Data Collected

0

Very critical/catastrophic server logs only.

1

Diagnostic data that helps in assessing usage patterns, health of the cache system, and any potential errors. This is the default configuration level.

2

Diagnostic data at fine grain granularity of all requests and important system information.

3

Diagnostic data with more verboseness and system information.

4

Highest verbosity logs for all requests and system information.

There are two types of caching diagnostic levels that correspond to cache client and cache server diagnostics. DiagnosticLevel represents cache server diagnostics, and ClientDiagnosticLevel represents cache client diagnostics. Each level configures a different set of performance counters, logs, traces, and crash dump settings. These diagnostic levels are configured in the ServiceConfiguration.cscfg file for the application, and may be changed for a running cloud application simply by deploying an updated ServiceConfiguration.cscfg file.

Cache Server Diagnostic Levels

The cache server diagnostic level for a cache cluster is specified in the ServiceConfiguration.cscfg file, in the configuration section for the role that hosts the cache cluster. This setting is added by Visual Studio when caching is enabled in the Caching tab for the role, and is already present when a Cache Worker Role is added to a project. The default DiagnosticLevel is 1, and if no DiagnosticLevel is present for the role then a DiagnosticLevel of 1 is used. To change the DiagnosticLevel, modify the DiagnosticLevel setting for the role in ServiceConfiguration.cscfg. The following example is the WorkerRole1 section from a ServiceConfiguration.cscfg file with a DiagnosticLevel of 1.

<Role name="WorkerRole1">
  <Instances count="1" />
  <ConfigurationSettings>
    <!-- Other settings omitted for clarity... -->
    <Setting name="Microsoft.WindowsAzure.Plugins.Caching.DiagnosticLevel" value="1" />
  </ConfigurationSettings>
</Role>

The following table lists the diagnostic data that is collected for each of the diagnostic levels.

 

DiagnosticLevel Data Collected

0

  • Log Level: Critical

  • No Performance Counters

  • No Event Logs registered

  • Mini Crash Dumps

1

2

  • Log Level: Information

  • Server Diagnostic Level 2 Performance Counters

  • The following event logs registered, in addition to the event logs from diagnostic level 1

    • Azure!*

    • Microsoft-Windows-Application Server-System Services/Admin!*

    • Microsoft-Windows-Application Server-System Services/Operational!*

  • Full Crash Dumps

3

4

noteNote
When running In-Role Cache applications in the Azure emulator, the traces for all role instances are collected under the *_IN_0 folder, even when there are multiple role instances. This behavior is by design. When In-Role Cache applications are hosted in Azure, the traces for each role instance are located in the respective folders for the role instances.

Cache Client Diagnostic Levels

The ClientDiagnosticLevel level for a cache client is specified in the ServiceConfiguration.cscfg, in the configuration section for the role that is the cache client. This setting is added by the In-Role Cache NuGet package when the role is configured to act as a cache client.

noteNote
For more information about configuring cache clients using the In-Role Cache NuGet package, see Configure a Project for Caching on Roles.

The default ClientDiagnosticLevel is 1, and if no ClientDiagnosticLevel is present for the role then a ClientDiagnosticLevel of 1 is used. To change the ClientDiagnosticLevel, modify the ClientDiagnosticLevel setting for the role in ServiceConfiguration.cscfg. The following example is the WebRole1 section from a ServiceConfiguration.cscfg file with a ClientDiagnosticLevel of 1.

<Role name="WebRole1">
  <Instances count="1" />
  <ConfigurationSettings>
    <!-- Other settings omitted for clarity... -->
    <Setting name="Microsoft.WindowsAzure.Plugins.Caching.ClientDiagnosticLevel" value="1" />
  </ConfigurationSettings>
</Role>

The following table lists the diagnostic data that is collected for each of the client diagnostic levels.

noteNote
Crash dump settings for the client diagnostic levels are relevant only to cache clients using the Memcached client shim. Crash dumps are not collected for non-Memcache clients. For more information about the Memcached client shim, see Memcached Wrapper for Azure Cache.

 

ClientDiagnosticLevel Data Collected

0

  • Log Level: Critical

  • No Performance Counters

  • No Event Logs registered

  • Mini Crash Dumps

1

2

3

4

noteNote
When running In-Role Cache applications in the Azure emulator, the traces for all role instances are collected under the *_IN_0 folder, even when there are multiple role instances. This behavior is by design. When In-Role Cache applications are hosted in Azure, the traces for each role instance are located in the respective folders for the role instances.

Configure Cache Diagnostics during Role Startup

To start the collection of caching diagnostic data, the following code must be invoked during role startup. This code must be added to each role that is a cache client or cache server in order for caching diagnostic data to be collected. One convenient place to host this code is in the role's OnStart override, as demonstrated in the following example.

public override bool OnStart()
{
    DiagnosticMonitorConfiguration dmConfig = 
        DiagnosticMonitor.GetDefaultInitialConfiguration();

    // Configure the collection of cache diagnostic data.
    CacheDiagnostics.ConfigureDiagnostics(dmConfig);

    DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", 
        dmConfig);

    return base.OnStart();
}

The ConfigureDiagnostics method configures the collection of caching diagnostic data. If this method is not called, caching diagnostic data is not collected. To use the CacheDiagnostics class, add a reference to Microsoft.ApplicationServer.Caching.AzureCommon.dll located in C:\Program Files\Microsoft SDKs\Azure\.NET SDK\2012-10\ref\Caching, and add the following using (or Imports) statement.

using Microsoft.ApplicationServer.Caching.AzureCommon;
noteNote
If the role has been configured as a cache client using the In-Role Cache NuGet package, then the Microsoft.ApplicationServer.Caching.AzureCommon.dll assembly reference is already added.

If you are adding caching to an existing role and diagnostic configuration code is already present, you can add the call to ConfigureDiagnostics to the existing diagnostic startup code before the call to Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitor.Start.

WarningWarning
Calling both ConfigureDiagnostics and Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitor.Start is required for diagnostic data collection in In-Role Cache applications. If both of these methods are not called during role startup, caching diagnostic data is not collected.

Performance Counters by Diagnostic Level

The following sections contain lists of the performance counters included in each of the server and client diagnostic levels. Both In-Role Cache and performance counters are included. For a complete list with descriptions of the In-Role Cache performance counters, see Monitor In-Role Cache (Azure Cache). For more information about the performance counters, see Performance Counters in the .NET Framework.

Server Diagnostic Level 1 Performance Counters

DiagnosticLevel 1 contains the following performance counters.

  • \Azure Caching:Host\Average Secondary Response Time / operation Microsecond

  • \Azure Caching:Host\Total Data Size Bytes

  • \Azure Caching:Host\Total Client Requests

  • \Azure Caching:Host\Total Read Requests

  • \Azure Caching:Host\Total Object Count

  • \Azure Caching:Host\Total Failure Exceptions

  • \Memory\Available MBytes

  • \Process(CacheService)\Page Faults/sec

    • When running in the Azure emulator the counter name is \Process(CacheServiceEmulator)\Page Faults/sec

  • \Processor(_Total)\% Processor Time

  • \.NET CLR Memory(_Global_)\% Time in GC

Server Diagnostic Level 2 Performance Counters

DiagnosticLevel 2 contains the following performance counters.

  • \Azure Caching:Host\Average Secondary Response Time / operation Microsecond

  • \Azure Caching:Host\Total Data Size Bytes

  • \Azure Caching:Host\Total Client Requests

  • \Azure Caching:Host\Total Read Requests

  • \Azure Caching:Host\Total Object Count

  • \Azure Caching:Host\Total Failure Exceptions

  • \Processor(_Total)\% Processor Time

  • \.NET CLR Memory(_Global_)\% Time in GC

  • \Azure Caching:Host\Total Read Requests /sec

  • \Azure Caching:Host\Cache Miss Percentage

  • \Azure Caching:Host\Total Primary Data Size Bytes

  • \Azure Caching:Host\Total Allocated Directory Count

  • \Azure Caching:Host\Available Cache Item Percentage

  • \Azure Caching:Host\Total Available Cache Item Count

  • \Azure Caching:Host\Total Notification Delivered

  • \Azure Caching:Host\Total Eviction Runs

  • \Azure Caching:Host\Total Memory Evicted

  • \Azure Caching:Host\Total Evicted Objects

  • \Azure Caching:Host\Total Expired Objects

  • \Azure Caching:Host\Total Requests Served

  • \Azure Caching:Host\Total Write Operations

  • \.NET CLR LocksAndThreads(*)\Contention Rate / sec

  • \.NET CLR Memory(*)\% Time in GC

  • \.NET CLR Memory(*)\Gen 0 heap size

  • \.NET CLR Memory(*)\Gen 1 heap size

  • \.NET CLR Memory(*)\Gen 2 heap size

  • \.NET CLR Memory(*)\Large Object Heap size

  • \Memory\Available MBytes

  • \Process(CacheService)\Page Faults/sec

    • When running in the Azure emulator the counter name is \Process(CacheServiceEmulator)\Page Faults/sec

  • \Process(*)\Thread Count

  • \Process(*)\Working Set

  • \Process(*)\Virtual Bytes

  • \Process(*)\Elapsed Time

  • \Process(*)\Page Faults/sec

  • \Network Interface(*)\Current Bandwidth

  • \Network Interface(*)\Bytes Total/sec

  • \Azure Caching:Host\Total Connections Count

  • \Azure Caching:Host\Average Quorum Response Time / operation Microsecond

  • \Azure Caching:Host\Total Client Requests /sec

  • \Azure Caching:Host\Total Notification Delivered

  • \Azure Caching:Host\Total Get Misses

  • \Azure Caching:Host\Total Write Operations /sec

Server Diagnostic Level 3 and 4 Performance Counters

DiagnosticLevel 3 and DiagnosticLevel 4 contain the following performance counters.

  • \.NET CLR LocksAndThreads(*)\Contention Rate / sec

  • \.NET CLR LocksAndThreads(*)\Current Queue Length

  • \.NET CLR Memory(*)\# Bytes in all Heaps

  • \.NET CLR Memory(*)\# Gen 0 Collections

  • \.NET CLR Memory(*)\# Gen 1 Collections

  • \.NET CLR Memory(*)\# Gen 2 Collections

  • \.NET CLR Memory(*)\% Time in GC

  • \.NET CLR Memory(*)\Gen 0 heap size

  • \.NET CLR Memory(*)\Gen 1 heap size

  • \.NET CLR Memory(*)\Gen 2 heap size

  • \.NET CLR Memory(*)\Large Object Heap size

  • \.NET CLR Exceptions(*)\# of Exceps Thrown

  • \Memory\Available MBytes

  • \Memory\Page Faults/sec

  • \PhysicalDisk(_Total)\% Idle Time

  • \PhysicalDisk(_Total)\Avg. Disk Queue Length

  • \Processor(_Total)\% Privileged Time

  • \Processor(_Total)\% Processor Time

  • \System\Context Switches/sec

  • \System\Processor Queue Length

  • \Process(*)\% Processor Time

  • \Process(*)\Handle Count

  • \Process(*)\Private Bytes

  • \Process(*)\Thread Count

  • \Process(*)\Working Set

  • \Process(*)\Virtual Bytes

  • \Process(*)\Elapsed Time

  • \Process(*)\Page Faults/sec

  • \Process(CacheService)\Page Faults/sec

    • When running in the emulator the counter name is \Process(CacheServiceEmulator)\Page Faults/sec

  • \Network Interface(*)\Current Bandwidth

  • \Network Interface(*)\Packets/sec

  • \Network Interface(*)\Bytes Sent/sec

  • \Network Interface(*)\Bytes Received/sec

  • \Network Interface(*)\Bytes Total/sec

  • \System\System Up Time

  • \Azure Caching:Host\Available Cache Item Percentage

  • \Azure Caching:Host\Total Connections Count

  • \Azure Caching:Host\Available Directory Percentage

  • \Azure Caching:Host\Available Memory Percentage

  • \Azure Caching:Host\Average Quorum Response Time / operation Microsecond

  • \Azure Caching:Host\Average Secondary Response Time / operation Microsecond

  • \Azure Caching:Host\Cache Miss Percentage

  • \Azure Caching:Host\Gateway Process Time

  • \Azure Caching:Host\Gateway Failure Percentage

  • \Azure Caching:Host\Request Processing Error Percentage

  • \Azure Caching:Host\Total Allocated Cache Item Count

  • \Azure Caching:Host\Total Allocated Directory Count

  • \Azure Caching:Host\Total Available Cache Item Count

  • \Azure Caching:Host\Total Available Directory Count

  • \Azure Caching:Host\Total Available Memory Bytes

  • \Azure Caching:Host\Total Cache Misses

  • \Azure Caching:Host\Total Cache Misses /sec

  • \Azure Caching:Host\Total Client Requests

  • \Azure Caching:Host\Total Client Requests /sec

  • \Azure Caching:Host\Total Data Size Bytes

  • \Azure Caching:Host\Total Evicted Objects

  • \Azure Caching:Host\Total Eviction Runs

  • \Azure Caching:Host\Total Expired Objects

  • \Azure Caching:Host\Total Failure Exceptions

  • \Azure Caching:Host\Total Failure Exceptions /sec

  • \Azure Caching:Host\Total Memory Evicted

  • \Azure Caching:Host\Total Notification Delivered

  • \Azure Caching:Host\Total Notification Delivered /sec

  • \Azure Caching:Host\Total Notification Poll Requests

  • \Azure Caching:Host\Total Notification Poll Requests /sec

  • \Azure Caching:Host\Total Object Count

  • \Azure Caching:Host\Total Objects Returned

  • \Azure Caching:Host\Total Objects Returned /sec

  • \Azure Caching:Host\Total Primary Data Size Bytes

  • \Azure Caching:Host\Total Get Misses

  • \Azure Caching:Host\Total Get Misses /sec

  • \Azure Caching:Host\Total Get Requests

  • \Azure Caching:Host\Total Get Requests /sec

  • \Azure Caching:Host\Total GetAndLock Requests

  • \Azure Caching:Host\Total GetAndLock Requests /sec

  • \Azure Caching:Host\Total Memory Evicted

  • \Azure Caching:Host\Total Read Requests

  • \Azure Caching:Host\Total Read Requests /sec

  • \Azure Caching:Host\Total Requests Served

  • \Azure Caching:Host\Total Requests Served /sec

  • \Azure Caching:Host\Total Retry Exception

  • \Azure Caching:Host\Total Retry Exception /sec

  • \Azure Caching:Host\Total Secondary Data Size Bytes

  • \Azure Caching:Host\Total Successful GetAndLock Requests

  • \Azure Caching:Host\Total Successful GetAndLock Requests /sec

  • \Azure Caching:Host\Total Write Operations

  • \Azure Caching:Host\Total Write Operations /sec

Client Diagnostic Level 1 Performance Counters

ClientDiagnosticLevel 1 contains the following performance counters.

  • \Azure Caching:Client Host\Failure Exceptions

  • \Azure Caching:Client Host\Total Local Cache Hits

  • \Azure Caching:Client Host\Current Server Connections

  • \Azure Caching:Client Host\Average Get Latency / operation Microsecond

  • \Azure Caching:Client Host\Average Put Latency / operation Microsecond

  • \Azure Caching:Client Host\Retry Exceptions

  • \Azure Caching:Client Host\Timeout Exceptions

  • \Azure Caching:Client Host\Requests

  • \Processor(_Total)\% Processor Time

  • \.NET CLR Memory(_Global_)\% Time in GC

  • \Azure Caching:Client(*)\Failure Exceptions

  • \Azure Caching:Client(*)\Total Local Cache Hits

  • \Azure Caching:Client(*)\Current Server Connections

  • \Azure Caching:Client(*)\Average Get Latency / operation Microsecond

  • \Azure Caching:Client(*)\Average Put Latency / operation Microsecond

  • \Azure Caching:Client(*)\Retry Exceptions

  • \Azure Caching:Client(*)\Timeout Exceptions

  • \Azure Caching:Client(*)\Requests

Client Diagnostic Level 2, 3, and 4 Performance Counters

ClientDiagnosticLevel 2, 3, and 4 contain the following performance counters.

  • \Azure Caching:Client Host\Requests

  • \Azure Caching:Client Host\Requests / sec

  • \Azure Caching:Client Host\Server Responses Dropped / sec

  • \Azure Caching:Client Host\Failure Exceptions

  • \Azure Caching:Client Host\Failure Exceptions / sec

  • \Azure Caching:Client Host\Average Get Latency / operation Microsecond

  • \Azure Caching:Client Host\Average Put Latency / operation Microsecond

  • \Azure Caching:Client Host\Average Get Latency (Network) / operation Microsecond

  • \Azure Caching:Client Host\Read Requests

  • \Azure Caching:Client Host\Write Requests

  • \Azure Caching:Client Host\Bytes Received / sec

  • \Azure Caching:Client Host\Bytes Sent / sec

  • \Azure Caching:Client Host\Current Server Connections

  • \Azure Caching:Client Host\Local Cache Filled Percentage

  • \Azure Caching:Client Host\Local Cache Hits Percentage

  • \Azure Caching:Client Host\Total Local Cache Hits

  • \Azure Caching:Client Host\Total Local Cache Objects

  • \Azure Caching:Client Host\Total Notifications Received

  • \Azure Caching:Client Host\Timeout Exceptions

  • \Azure Caching:Client Host\Timeout Exceptions / sec

  • \Azure Caching:Client Host\Retry Exceptions

  • \Azure Caching:Client Host\Retry Exceptions / sec

  • \Azure Caching:Client Host\Total Connection Requests Failed

  • \Azure Caching:Client Host\Network Exceptions

  • \Azure Caching:Client Host\Network Exceptions / sec

  • \Azure Caching:Client Host\Current Waiting Requests

  • \Processor(_Total)\% Processor Time

  • \.NET CLR Memory(_Global_)\% Time in GC

  • \Azure Caching:Client(*)\Requests

  • \Azure Caching:Client(*)\Requests / sec

  • \Azure Caching:Client(*)\Server Responses Dropped / sec

  • \Azure Caching:Client(*)\Failure Exceptions

  • \Azure Caching:Client(*)\Failure Exceptions / sec

  • \Azure Caching:Client(*)\Average Get Latency / operation Microsecond

  • \Azure Caching:Client(*)\Average Put Latency / operation Microsecond

  • \Azure Caching:Client(*)\Average Get Latency (Network) / operation Microsecond

  • \Azure Caching:Client(*)\Read Requests

  • \Azure Caching:Client(*)\Write Requests

  • \Azure Caching:Client(*)\Bytes Received / sec

  • \Azure Caching:Client(*)\Bytes Sent / sec

  • \Azure Caching:Client(*)\Current Server Connections

  • \Azure Caching:Client(*)\Local Cache Filled Percentage

  • \Azure Caching:Client(*)\Local Cache Hits Percentage

  • \Azure Caching:Client(*)\Total Local Cache Hits

  • \Azure Caching:Client(*)\Total Local Cache Objects

  • \Azure Caching:Client(*)\Total Notifications Received

  • \Azure Caching:Client(*)\Timeout Exceptions

  • \Azure Caching:Client(*)\Timeout Exceptions / sec

  • \Azure Caching:Client(*)\Retry Exceptions

  • \Azure Caching:Client(*)\Retry Exceptions / sec

  • \Azure Caching:Client(*)\Total Connection Requests Failed

  • \Azure Caching:Client(*)\Network Exceptions

  • \Azure Caching:Client(*)\Network Exceptions / sec

  • \Azure Caching:Client(*)\Current Waiting Requests

See Also

Gruppinnehåll

Lägg till
Visa:
© 2014 Microsoft