Production Debugging in a Serverless World

Slides:



Advertisements
Similar presentations
Borland Optimizeit™ Profiler for the Microsoft .NET Framework
Advertisements

DIGIDOC A web based tool to Manage Documents. System Overview DigiDoc is a web-based customizable, integrated solution for Business Process Management.
Production 100mph. About Me Co-founder – Takipi (God mode in Production Code). Co-founder – VisualTao (acquired by Autodesk). Director, AutoCAD.
CS 501: Software Engineering Fall 2000 Lecture 16 System Architecture III Distributed Objects.
Java for High Performance Computing Jordi Garcia Almiñana 14 de Octubre de 1998 de la era post-internet.
JETT 2003 Java.compareTo(C++). JAVA Java Platform consists of 4 parts: –Java Language –Java API –Java class format –Java Virtual Machine.
What Can You do With BTM? Business Transaction Management touches the following disciplines:  Performance Management  Application Management  Capacity.
Interesting facts about node.js.  Asynchronous I/O  How do they do that?..threads (usually) What do Web Servers do?
JAVA v.s. C++ Programming Language Comparison By LI LU SAMMY CHU By LI LU SAMMY CHU.
Windows.Net Programming Series Preview. Course Schedule CourseDate Microsoft.Net Fundamentals 01/13/2014 Microsoft Windows/Web Fundamentals 01/20/2014.
Testing Tools. Categories of testing tools Black box testing, or functional testing Testing performed via GUI. The tool helps in emulating end-user actions.
A Portable Virtual Machine for Program Debugging and Directing Camil Demetrescu University of Rome “La Sapienza” Irene Finocchi University of Rome “Tor.
© 2012 IBM Corporation Rational Insight | Back to Basis Series Chao Zhang Unit Testing.
XML in Development of Distributed Systems Tooling Programming Runtime.
Analyzing parallel programs with Pin Moshe Bach, Mark Charney, Robert Cohn, Elena Demikhovsky, Tevi Devor, Kim Hazelwood, Aamer Jaleel, Chi- Keung Luk,
Visual Studio 2005 Team System: Building Robust & Reliable Software Tejasvi Kumar Technology Specialist - VSTS Microsoft Corporation
Google Web Toolkit An Overview By Shauvik Roy Choudhary.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
© 2006 IBM Corporation Agile Planning Web UI. © 2006 IBM Corporation Agenda  Overview of APT Web UI  Current Issues  Required Infrastructure  API.
JAVA Programming “When you are willing to make sacrifices for a great cause, you will never be alone.” Instructor: รัฐภูมิ เถื่อนถนอม
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
TAKE – A Derivation Rule Compiler for Java Jens Dietrich, Massey University Jochen Hiller, TopLogic Bastian Schenke, BTU Cottbus/REWERSE.
Testing in Android. Methods Unit Testing Integration Testing System Testing Regression Testing Compatibility Testing Black Box (Functional) White Box.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Creating SmartArt 1.Create a slide and select Insert > SmartArt. 2.Choose a SmartArt design and type your text. (Choose any format to start. You can change.
Visual Studio Team System overview Pierre Greborio Software Architect – PEWay Microsoft MVP – Solutions Architect.
Slide 1. Agenda  Introduction to Windows Workflow What is it? What are activities? Hosting  Out of the box Activities  Custom Activities and Dependency.
Vertical Profiling : Understanding the Behavior of Object-Oriented Applications Sookmyung Women’s Univ. PsLab Sewon,Moon.
© 2002 IBM Corporation Confidential | Date | Other Information, if necessary Eclipse™ TPTP 4.6 Release Review Minideck June 1, 2009 Eclipse TPTP PMC &
Integrating and Extending Workflow 8 AA301 Carl Sykes Ed Heaney.
The best of WF 4.0 and AppFabric Damir Dobric MVP-Connected System Developer Microsoft Connected System Division Advisor Visual Studio Inner Circle member.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
DATA Storage and analytics with AZURE DATA LAKE
Building Enterprise Applications Using Visual Studio®
Build Fundamentals and Continuous Integration
GlassFish Performance Tuning: Tips from the Field
14 Compilers, Interpreters and Debuggers
Designing and Implementing an ETL Framework
Google App Engine Mandeep Singh (37926)
Building Innovative Apps using the Microsoft Developer Platform
Robotic Process Automation Training| RPA online Training at GoLogica
Web Applications Security What are web Applications?
Yongle Zhang, Serguei Makarov, Xiang Ren, David Lion, Ding Yuan
Introduction Enosis Learning.
Digital Measures Replacement
CMPE419 Mobile Application Development
Course Name: QTP Trainer: Laxmi Duration: 25 Hrs Session: Daily 1 Hr.
Module 1: Getting Started
Continuous Performance Engineering
Introduction Enosis Learning.
Getting Started ARCS Lab..
Human Complexity of Software
Near Real Time ETLs with Azure Serverless Architecture
Evaluating Transaction System Performance
ColdFusion Performance Troubleshooting and Tuning
Google App Engine Ying Zou 01/24/2016.
Your code is not just…your code
Serverless Architecture in the Cloud
java architect lead performance engineer FIS Global @EOstermueller
Chap 1. Getting Started Objectives
Chap 4. Programming Fundamentals
CMPE419 Mobile Application Development
JIT Compiler Design Maxine Virtual Machine Dhwani Pandya
Java Virtual Machine Profiling. Agenda Introduction JVM overview Performance concepts Monitoring Profiling VisualVM demo Tuning Conclusions.
Johan Lindberg, inRiver
.Net for Test and Measurement
Outcome of the Lecture Upon completion of this lecture you will be able to understand Fundamentals and Characteristics of Java Language Basic Terminology.
Customer 360.
Your code is not just…your code
Presentation transcript:

Production Debugging in a Serverless World

About Me Co-founder – OverOps (God mode in Production Code). Co-founder – VisualTao (acquired by Autodesk). Director, AutoCAD Web & Mobile. Software Architect at IAI Aerospace. Coding for the past 16 years - C++, Delphi, .NET, Java. Focus on real-time, scalable systems. Blogs at blog.takipi.com

Overview Microservices and Serverless and Lambda architectures open up a whole world of opportunity for app development. The enable easy of use while deploying and operating at scale. But with that comes loss of control over the JVM and lessened run-time introspection capabilities.

JVM Debugging in a Serverless World Unavailable Capabilities Available Capabilities Global Exception Handlers Logging jstack Metrics Java Agent / VM API Proprietary (AWS-Xray ) Btrace JVMTI HSDB

Global Exception Handlers Your last line of defense - critical to pick up on unhandled exceptions. Setting the callback: This is where thread Name + TLS are critical as the only surviving state. public static void Thread.setDefaultUncaughtExceptionHandler(UncaughtExceptionHandler eh) void UncaughtExceptionHandler.uncaughtException(Thread t, Throwable e) { logger.error(“Uncaught error in thread “ + t, e); }

Preemptive jstack A production debugging foundation. Presents two issues – Activated only in retrospect. No state: does not provide any variable state. Let’s see how we can overcome these with preemptive jstacks. github.com/takipi/jstack

Part1: Stateful Thread Names Thread name is a mutable property. Can be set to hold transaction specific state in tandem with jstack. Can be automated. At code entry point: Thread.currentThread().setName(Context, TID, Params, Time,..) "pool-1-thread-1" #17 prio=5 os_prio=31 tid=0x00007f9d620c9800 nid=0x6d03 in Object.wait() [0x000000013ebcc000] ”pool-1-thread-25 MsgID: AB5CAD, type: Analyze, queue: ACTIVE_PROD, TID: 5678956, TS: 11/8/20014 18:34 " #17 prio=5 os_prio=31 tid=0x00007f9d620c9800 nid=0x6d03 in Object.wait() [0x000000013ebcc000]

60-100% /performance (LongAdder: 60-100% > Atomics)

60-100% /performance Native frames, monitors

Custom Java Agents An advanced technique for instrumenting code dynamically. The foundation for most profiling / debugging tools. Two types of agents: Java and Native. Pros: extremely powerful technique to collect state from a live app. Cons: requires knowledge of creating verifiable bytecode. github.com/takipi/debugAgent github.com/takipi/profiling-agent

BTrace An advanced open-source tool for extracting state from a live JVM. Uses a Java agent and a meta-scripting language to capture state. Pros: Lets you probe variable state without modifying / restarting the JVM. Cons: read-only querying using a custom syntax and libraries. github.com/btraceio/btrace

Native Agents Java agents are written in Java. Have access to the Instrumentation API. Native agents – written in C++. Have access to JVMTI – the JVM’s low-level set of APIs and capabilities. JIT compilation, GC, Monitor, Exception, breakpoints, .. More complex to write. Capability performance impact. Platform dependent. docs.oracle.com/javase/8/docs/platform/jvmti/jvmti.html

HSDB / Serviceability API A powerful backdoor into the Hotspot JVM. Complete access into discrete internal JVM classes from within the JVM or externally. Requires intimate understanding of the JVM. The most powerful way to introspect the state of the JVM. Can be run externally or from within the JVM.

JVM Debugging in a Serverless World Unavailable Capabilities Available Capabilities Global Exception Handlers Logging jstack Metrics Java Agent / VM API Proprietary (AWS-Xray ) Btrace JVMTI HSDB

AWS Lambdas: X-Ray A distributed framework for tracing distributed workflows. Pros: out-of-the-box, scalable, wired into AWS. Cons: proprietary, manual code instrumentation, less capable than agents, requires continuous connectivity to AWS.

Lambda Logging Best Practices Logging has become increasingly more important in the age of Microservices and now Lambda functions. Make sure these are baked into your logging context – Transaction ID (for distributed tracing). Distributed DEBUG-level log throttling. Handle inner / fatal and timeouts.

Distributed Transaction ID Logging is usually a multi–threaded / process affair. Generate a UUID at every thread entry point into your app – the transaction ID. Should have sample-able attributes. Must be persistent. Append the ID into each log entry. Try to maintain it across machines – critical for distributed / async debugging.

Serverless Lambdas – Guardian Angel A template framework to apply the following techniques within an AWS lambda: Stateful thread naming Global exception handling Preemptive jstack Timeout and critical failure state capture Considerations: consistent across distributed flows, Throttles at scale, minimal code change.