Monitoring and troubleshooting Windows Azure apps

Slides:



Advertisements
Similar presentations
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Advertisements

Web RoleWorker Role At runtime each Role will execute on one or more instances A role instance is a set of code, configuration, and local data, deployed.
MIX 09 4/15/ :14 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Building Scalable Cloud Applications David Aiken Windows Azure Technical Specialist Microsoft Corporation.
Faith Allington Program Manager Microsoft Corporation Session Code: WSV304.
Wade Wegner Windows Azure Technical Evangelist Microsoft Corporation Real World Windows Azure Development – Tips & Tricks.
Co- location Mass Market Managed Hosting ISV Hosting.
05 | Configuration and Deployment Richard Currey | Senior Technical Trainer–New Horizons United George Squillace | Senior Technical Trainer–New Horizons.
Node.js on Windows Azure Name Title Microsoft Corporation.
Get more control & flexibility of the Windows Azure environment Developers IT Pros Easier migration of existing Windows applications to Windows Azure.
Session 1.
Windows Azure Web Sites Speaker Title Organization.
Getting Started with Windows Azure Name Title Microsoft Corporation.
A Windows Azure application runs multiple instances of each role A Windows Azure application behaves correctly when.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:
Pradeep Kumar C Support Escalation Engineer Windows Azure Diagnostics Logging and Monitoring in the Cloud.
SQL Server SQL Azure Visual Studio“Quadrant” SQL Server Modeling Services Entity Framework ADO.NET“M”/EDM Data Services …
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.

customer.
demo © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
demo Demo.
demo QueryForeign KeyInstance /sm:body()/x:Order/x:Delivery/y:TrackingId1Z
Ramesh Meyyappan SQL Server Performance Tuning Consultant & Trainer SQLWorkshops.comSQLWorkshops.com / SQLIO.comSQLIO.com.
Inside Azure Diagnostics 17 COLUMBUS, OHOCTOBER 17, 2014CLOUDDEVELOP.ORG.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks.
06 | Debugging and Deploying on Azure Stacey Mulcahy | Technical Evangelist Rami Sayar | Technical Evangelist.
05 | Debugging and Deploying on Azure Stacey Mulcahy | Technical Evangelist Rami Sayar | Technical Evangelist.
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.

MIX 09 11/30/2017 5:54 AM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
IT Operations Management
Microsoft Azure P wer Lunch
IT Operations Management
TechEd /14/2018 6:55 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Exceedra + Azure Mark Rendle Principal Software Architect
Debugging and troubleshooting Azure applications using Visual Studio
Introduction to Windows Azure Web Sites
TechEd /14/2018 6:26 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
Microsoft Ignite NZ October 2016 SKYCITY, Auckland.
Windows Azure 講師: 李智樺, Ruddy Lee
Azure Development Using Visual Studio
持續的產出Windows Azure 雲端服務
Microsoft Virtual Academy
Introduction to Building Applications with Windows Azure
Customizing WPA Trace Views
Getting started with Windows Azure
System Center Application Management
Jim Nakashima Program Manager Cloud Tools
System Admin Best Practices for NAV 2013 R2
ASP.NET 4 Core Runtime for Web Developers
MDC-B203 Deploying Applications in Microsoft System Center Virtual Machine Manager Using Services John Messec Program Manager Microsoft.
Migrating your applications to Azure
Create rich, data-driven Web apps with ASP.NET 4.5 Web Forms
Developing for Windows Azure
Tech Ed North America /12/2019 6:45 AM Required Slide
8/04/2019 9:13 PM © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Виктор Хаджийски Катедра “Металургия на желязото и металолеене”
Service Template Creation from the Ground Up
Developing Windows Azure Applications with Visual Studio
Шитманов Дархан Қаражанұлы Тарих пәнінің
Day 2, Session 2 Connecting System Center to the Public Cloud
Office 365 Development July 2014.
Making Windows Azure Relevant to IT Professionals
New, Old or Pink - it is all good
Presentation transcript:

Monitoring and troubleshooting Windows Azure apps 11/18/2018 11:15 AM SAC-859T Monitoring and troubleshooting Windows Azure apps Michael Washam Senior Technical Evangelist Microsoft Corporation © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Agenda Windows Azure Diagnostics for Application Monitoring Windows Azure PowerShell Cmdlets for Diagnostics Configuring and Analyzing Diagnostic Data Debugging and Troubleshooting Windows Azure Applications

Windows Azure Diagnostics Distributed Application Monitoring and Data Collection Choose what to collect & when to collect it Event Logs, Trace Logs, Performance Counters IIS Web/Failed Request Logs, Crash Dumps, Other Log files (custom apps, other web/app servers) Cloud Friendly Manage multiple role instances centrally Scalable Remotely Configurable (Not a replacement for Outside-In Monitoring)

Diagnostics: Single Server vs. the Cloud Static Environment Single well-known instance Traceable local transactions Local Access Feasible All in one TS session Data & tools co-located In-Place Changes Dynamic Environment Multi-instance, elastic capacity Distributed work loads Local Access Infeasible Many nodes Distributed, scaled-out data

How does it work (in a nutshell)? Role Instance Starts Role Instance Diagnostic Monitor Starts Role Diagnostic Monitor Monitor is configured Imperatively at Start time Remotely any time Configuration is saved in Storage Local directory storage Monitor buffers data locally User can set a quota (FIFO) User initiates transfer to storage from local buffer Scheduled On Demand

Local directory storage Remote Configuration Poll Interval Role Role Instance Diagnostic Monitor Local directory storage

Diagnostic Data Locations WAD-Control-Container Contains XML Configuration for each Role Instance in the Service Diagnostic Data Location in Storage Windows Event Logs WADWindowsEventLogsTable Performance Counters WADPerformanceCountersTable Windows Azure Logs WADLogsTable Diagnostic Infrastructure Logs WADDiagnosticInfrastructureLogsTable IIS Logs wad-iis-logfiles - WADDirectoriesTable (index entry) IIS Failed Request Logs wad-iis-failedreqlogfiles - WADDirectoriesTable (index entry) Crash Dumps wad-crash-dumps - WADDirectoriesTable (index entry) Custom File Based Logs (must be configured) - WADDirectoriesTable (index entry)

Configuring Diagnostics Enable Programmatically using DiagnosticMonitor.Start() Enable Declaratively Using the Diagnostics Module Configuring Diagnostics DiagnosticsMonitor /RoleInstanceDiagnosticManager diagnostics.wadcfg (XML Configuration File) Diagnostic Tools Azure MMC, Operations Manager , Cerebrata, many others… Windows Azure PowerShell Cmdlets

Diagnostic Monitor (Role Startup) Start off with default configuration DiagnosticMonitorConfiguration dc = DiagnosticMonitor.GetDefaultInitialConfiguration(); dc.WindowsEventLog.DataSources.Add("Application!*"); dc.WindowsEventLog. ScheduledTransferLogLevelFilter = LogLevel.Error; dc.WindowsEventLog.ScheduledTransferPeriod = System.TimeSpan.FromMinutes(5.0); // add other sources DiagnosticMonitor.Start("DiagnosticsConnectionString", dc); Determine what to log and when to transfer to storage. Start the monitor

RoleInstanceDiagnosticManager (anytime) Initialize RoleInstanceDiagnosticManager CloudStorageAccount storage = CloudStorageAccount.Parse(…); RoleInstanceDiagnosticManager rdm = new RoleInstanceDiagnosticManager(storage, DeploymentId, RoleName, RoleInstanceId); DiagnosticMonitorConfiguration config = rdm.GetCurrentConfiguration(); dc.WindowsEventLog.DataSources.Add("Application!*"); dc.WindowsEventLog. ScheduledTransferLogLevelFilter = LogLevel.Error; dc.WindowsEventLog.ScheduledTransferPeriod = TimeSpan.FromMinutes(5.0); // add other sources rdm.SetCurrentConfiguration(config); Get Current Config What to log and when to transfer it to storage. Set Current Config

Understanding Diagnostics Configuration Common Properties OverallQuotaInMB BufferQuotaInMB (per source) ScheduledTransferPeriodInMinutes (per source) ScheduledTransferLogLevelFilter Windows Event Logs, Windows Azure Logs Diagnostic Infrastructure Logs) Subscriptions Windows Event Logs (Application, System etc... ) Performance Counters (Counter Specifier, Sample Interval) Directories (Path, Container and DirectoryQuotaInMB)

PowerShell CmdLets for Windows Azure NEW Functionality Download Diagnostic Data Convert Performance Counters to BLG format Blobs/CSV Data for the Rest Delete/Clean Diagnostic Data in Storage Other New Functionality Hosted Services Storage Accounts Affinity Groups SQL Azure Storage Analytics Download from Storage Containers

Diagnostics with PowerShell Add-PsSnapin WAPPSCmdlets get-hostedservice –servicename $name –cert $cert –subscriptionid $id | get-deployment $deploymentSlot | Get-DiagnosticAwareRoles -StorageAccountName $acc -StorageAccountKey $key | foreach { # Configure diagnostics for each role instance in the role $_ | Set-WindowsEventLog … $_ | Set-PerfmonLog … $_ | Set-FileBasedLog … $_ | Set-InfrastructureLog … $_ | Set-WindowsAzureLog … }

Contoso Mortgage Web Application

YSOD - Refer a Friend

No Response From the Server

Monthly Payment = “Infinity”

Windows Azure Diagnostics Demo Windows Azure Diagnostics

Debugging Windows Azure Apps Where Does My Code Run? Windbg.exe –pn ???

Load Balancer External Requests Full IIS Host (<sites>) WAHostBootStrapper.exe Hosted Web Core (No <sites>) Startup Tasks IISConfigurator.exe WAIISHost.exe Web Role Startup WAWebHost.exe Web Role Startup ASP.NET Code WAWorkerHost.exe Worker Role Code Diagnostics Agent W3WP.exe ASP.NET Code Other Frameworks PHP etc.. Optional – Custom Executable Started by Worker Role Remote Access Agent Other Frameworks PHP etc.. Remote Forwarder Agent Load Balancer External Requests

Debugging Unhandled Exceptions First Line of Defense Exception Handling/Tracing CrashDumps.EnableCollection(bool) Doesn’t Support ASP.NET Well Worker Role Process Only Visual Studio Intellitrace Non Production (for VS2010 anyways) Allows Playback of Execution Environment Managed Code Only Traditional Tools – ADPlus/DebugDiag/WinDBG

Troubleshooting Performance Problems Analyzing Performance Counter Data High CPU Utilization, Disk Queuing, Memory Leaks etc.. Using the Visual Studio Profiler Inefficient Code, Memory Leaks, “Hot Areas” Conditional Tracing Track Call Times of Suspect Code Gaining insight into your app with Storage Analytics Why do I read/write to/from that blob so much?

Logging Call Times – (Cheap profiler…) BooleanSwitch perfSwitch = new BooleanSwitch("perfSwitch", "perfSwitch“, RoleEnvironment.GetConfigurationSettingValue(“TestPerfSwitch")); Stopwatch sw = null; if (perfSwitch.Enabled) { sw = new Stopwatch(); sw.Start(); } // lengthy operation sw.Stop(); System.Diagnostics.Trace.WriteLine("Method time (ms): " + sw.ElapsedMilliseconds);

Troubleshooting Startup Tasks Understand the architecture Simple, Foreground and Background Startup Tasks Logging output of batch file commands command > cmdOutput.txt Weird PowerShell Errors? osFamily=“2” to use PowerShell 2.0 Runs the Server with Server 2008 R2 Ensure that added content is marked “Copy Always” Use RDP and test locally from the E: drive. exit /b 0

Debugging Tips & Tricks Demo Debugging Tips & Tricks

Other Resources WA PowerShell Cmdlets Download and Tips – Logging exceptions to blob storage example: http://blog.smarx.com/posts/printf-here-in-the-cloud TraceListener to Storage Tables: http://blog.smarx.com/posts/lightweight-tracing-to-windows-azure-tables For In-Depth Information on Logging and Tracing See the June 2010 Issue of MSDN Magazine: “Take Control of Logging and Tracing in Windows Azure” Monitoring Windows Azure with Operations Manager http://aka.ms/AzureSCOM2007 Cerebrata – Diagnostics Manager and other great Windows Azure Tools http://www.cerebrata.com/

thank you Feedback and questions http://forums.dev.windows.com Session feedback http://bldw.in/SessionFeedback

11/18/2018 11:15 AM © 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. © 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.