我正在尝试启动并运行角色内缓存。
我很难确定是否正在使用缓存(因为我们已经有一个包装器,如果缓存不可用则优雅地返回null - 但是很难解决)。
我一直在阅读这些文章: Monitor In-Role Cache In-Role Cache For Windows Azure
我想使用管理控制台检查缓存上的读/写或其他指标,以确定缓存是否正常工作。但我没有看到任何地方查看这些数据。
角色的添加度量标准窗口不包含任何缓存数据(尽管我可以看到在配置屏幕上配置了缓存)。
有什么建议吗?我在这里疯了。
答案 0 :(得分:4)
将diagnostics.wadcfg添加到您感兴趣的缓存性能计数器的角色中,即
<?xml version="1.0" encoding="utf-8"?>
<DiagnosticMonitorConfiguration configurationChangePollInterval="PT1M" overallQuotaInMB="4096" xmlns="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration">
<DiagnosticInfrastructureLogs />
<Directories>
<CrashDumps container="wad-crash-dumps" />
</Directories>
<Logs bufferQuotaInMB="1024" scheduledTransferPeriod="PT1M" scheduledTransferLogLevelFilter="Error" />
<WindowsEventLog bufferQuotaInMB="1024" scheduledTransferPeriod="PT1M" scheduledTransferLogLevelFilter="Error">
<DataSource name="Application!*" />
</WindowsEventLog>
<PerformanceCounters bufferQuotaInMB="512" scheduledTransferPeriod="PT5M">
<PerformanceCounterConfiguration counterSpecifier="\Memory\Available MBytes" sampleRate="PT3M" />
<PerformanceCounterConfiguration counterSpecifier="\Windows Azure Caching:Host\Available Cache Item Percentage" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\Windows Azure Caching:Host\Cache Miss Percentage" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\Windows Azure Caching:Host\Throttled Connections Count" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\Windows Azure Caching:Host\Total Allocated Cache Item Count" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\Windows Azure Caching:Host\Total Cache Misses /sec" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\Windows Azure Caching:Host\Total Client Requests /sec" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\Windows Azure Caching:Host\Total Connections Count" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\Windows Azure Caching:Host\Total Failure Exceptions /sec" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\Windows Azure Caching:Host\Total Get Misses /sec" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\Windows Azure Caching:Host\Total Get Requests /sec" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\Windows Azure Caching:Host\Total GetAndLock Requests /sec" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\Windows Azure Caching:Host\Total Notification Delivered /sec" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\Windows Azure Caching:Host\Total Object Count" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\Windows Azure Caching:Host\Total Objects Returned /sec" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\Windows Azure Caching:Host\Total Read Requests /sec" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\Windows Azure Caching:Host\Total Requests Served /sec" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\Windows Azure Caching:Host\Total Retry Exception /sec" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\Windows Azure Caching:Host\Total Successful GetAndLock Requests /sec" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\Windows Azure Caching:Host\Total Write Operations /sec" sampleRate="PT3M"/>
<PerformanceCounterConfiguration counterSpecifier="\Windows Azure Caching:Host\Available Cache Item Percentage" sampleRate="PT3M"/>
</PerformanceCounters>
</DiagnosticMonitorConfiguration>
重新部署
答案 1 :(得分:1)
我试图做同样的事情。我得出结论,管理门户不允许您访问缓存性能计数器(至少使用Azure SDK 2.0,我正在使用)。
您正在查看的Monitor之后的下一个主题是In-Role cache troubleshooting。在那里,它建议您需要向WebRole.cs文件添加代码,更改诊断级别等。我还找到了一个关于Configuring azure Diagnostics的页面,我用它将各种缓存性能计数器添加到部署包和/或运行角色(使用Visual Studio Server Explorer)。
首先,我的缓存性能计数器(例如“\ Azure Caching:Host \ Total Object Count”)未记录任何数据。只有当我远程访问实例并运行perfmon.exe时,才注意到计数器的名称实际上是以下形式:“\ Windows Azure Caching:Host \ Total Object Count”。我注意到前面的 Windows 位从未在性能计数器的名称中的任何位置提到过!同样,这可能是我的旧SDK。
我现在在配置诊断时指定的存储帐户中的WADPerformanceCountersTable表中出现了in角色缓存计数器。
我希望这会有所帮助。