SlideShare a Scribd company logo
TRANSACTION TRACING & ROOT
CAUSE ANALYSIS WITH
STRONGLOOP ARC
Jordan Kasper | Developer Evangelist
STEP ONE
The first step in monitoring, profiling, and tracing your
Node application is to run it in a process manager!
BUILD YOUR APP WITH SLC
~$ npm install ­g strongloop
~/my­app$ slc build
...
~/my­app$ ls
... ...  my­app­0.1.0.tgz
INSTALL AND RUN STRONG PM
On your deployment machine...
~$ npm install ­g strong­pm
~$ sl­pm­install
DEPLOY TO STRONG PM
From our development machine (or staging, etc)...
~/my­app$ slc deploy http+ssh://myserver.com:8701
RUNNING LOCALLY
If you need to profile things locally (your machine or a
staging/testing server), run slc start from your app directory:
~/my­app$ slc start
Process Manager is attempting to run app `.`.
  To confirm it is started: slc ctl status tracing­example­app
  To view the last logs: slc ctl log­dump tracing­example­app
  ...
Then start the Arc UI:
~/my­app$ slc arc
METRICS AND MONITORING
VIEWING METRICS
AVAILABLE METRICS
CPU Load (system)
Heap Memory sage
Event Loop Count
Event Loop Tick Timing
HTTP Connections
Database Connections (Oracle, MySQL, Mongo, Postgres)
Misc other modules (Redis, Memcache(d), Message queues)
WHAT DO I LOOK FOR?
CPU Usage is pretty obvious, just watach your high points!
With Heap Memory Usage you want to see a "sawtooth"
chart, each drop indicates garbage collection. No drop is
bad!
WHAT DO I LOOK FOR?
WHAT DO I LOOK FOR?
The two Event Loop metrics are opposed. You want the
loop count to remain high under normal load (more ticks
per metrics cycle is good). Any dips may be bad.
The Loop timing, on the other hand, indicates how long
event loop ticks are taking. Any spikes here are bad!
SETUP METRICS COLLECTION
On our production machine, with strong-pm installed,
simply set the collection location:
~$ export STRONGLOOP_METRICS="log:/path/to/api­metrics.log"
~$ export STRONGLOOP_METRICS="syslog"
~$ export STRONGLOOP_METRICS="statsd://my­log­server.com:1234"
~$ export STRONGLOOP_METRICS="graphite://my­log­server.com:1234"
~$ export STRONGLOOP_METRICS="splunk://my­log­server.com:1234"
SETUP METRICS COLLECTION
Alternatively, on the production machine you can run:
~$ sl­pm­install ­­metrics <url>
Or during runtime:
~$ slc ctl env­set my­app STRONGLOOP_METRICS=<url>
PROFILING
PROFILING
We can spot issues using the metrics being monitored, but
now we need to find the cause of those issues.
Profiling CPU usage and memory is the way to do this.
PROFILING IN ARC
CPU PROFILES
MEMORY PROFILES
PROGRAMMATIC MEMORY MONITORING
If we have memory issues, it may be helpful to monitor
memory usage dynamically.
~$ npm install heapdump ­­save
var heapdump = require('heapdump');
var THRESHOLD = 500;
setInterval(function () {
    var memMB = process.memoryUsage().rss / 1048576;
    if (memMB > THRESHOLD) {
        process.chdir('/path/to/writeable/dir');
        heapdump.writeSnapshot();
    }
}, 60000 * 5);
MEMORY MONITORING
Caution: Taking a heap snapshot is not trivial on
resources.
If you already have a memory problem, this could kill your
process!
Unfortunately sometimes you have no alternative.
SMART PROFILING
How can we using the monitoring to profile?
"smart profiling" based on event loop blockage
~$ slc ctl cpu­start 1.1.49408 20
1. Monitors a specific worker (1.1.49408)
2. Event loop blocked for more than 20ms, start CPU profile
3. Stop profiling once event loop resumes
FINDING THE WORKER ID
~$ slc ctl status
Service ID: 1
Service Name: my­app
Environment variables:
  No environment variables defined
Instances:
    Version  Agent version  Cluster size
     4.1.0       1.5.1            4
Processes:
        ID      PID   WID  Listening Ports  Tracking objects?  CPU profilin
    1.1.49401  49401   0
    1.1.49408  49408   1     0.0.0.0:3001
    1.1.49409  49409   2     0.0.0.0:3001
    1.1.49410  49410   3     0.0.0.0:3001
    1.1.49411  49411   4     0.0.0.0:3001
TRANSACTION TRACING
DEEP TRANSACTIN TRACING
Analyze performance of your application from a high level
down to the function level.
RESOURCE CONSUMPTION TIMELINE
ANOMOLY INSPECTION
See something off?
Click on that point in the resource usage chart.
(The orange triangles at the bottom identify anomolies
betond three-sigma deviations.)
VIEW TRACE SEQUENCES
TRACING WATERFALL
By clicking on the "sync" line we can inspect the costs of the
synchronous code.
FLAME CHARTS
FLAME CHARTS
The flame chart identifies each function in the call stack,
organized in color by module.
The size of the bar represents the total resource
consumption for that function and all of its function calls.
Clicking on a function shows that functions resource usage.
LOOKING FOR MORE?
Check out our blog post on Transaction Tracing and
identifying a DoS attack!
http://bit.ly/arc-tracing
THANK YOU!
QUESTIONS?
Jordan Kasper | Developer Evangelist
Join us for more events!
strongloop.com/developers/events

More Related Content

Viewers also liked

Monitis Transaction Monitoring
Monitis Transaction MonitoringMonitis Transaction Monitoring
Monitis Transaction Monitoring
DM - Digital Marketing Consulting
 
Soluciones Dynatrace
Soluciones DynatraceSoluciones Dynatrace
Soluciones Dynatrace
Innovation Strategies
 
dynaTrace APM
dynaTrace APMdynaTrace APM
dynaTrace APM
gcarrsemail
 
Using dynaTrace to optimise application performance
Using dynaTrace to optimise application performanceUsing dynaTrace to optimise application performance
Using dynaTrace to optimise application performance
Richard Bishop
 
Dynatrace
DynatraceDynatrace
Dynatrace
Purnima Kurella
 
From APM to Business Monitoring with AppDynamics Analytics
From APM to Business Monitoring with AppDynamics AnalyticsFrom APM to Business Monitoring with AppDynamics Analytics
From APM to Business Monitoring with AppDynamics Analytics
AppDynamics
 

Viewers also liked (6)

Monitis Transaction Monitoring
Monitis Transaction MonitoringMonitis Transaction Monitoring
Monitis Transaction Monitoring
 
Soluciones Dynatrace
Soluciones DynatraceSoluciones Dynatrace
Soluciones Dynatrace
 
dynaTrace APM
dynaTrace APMdynaTrace APM
dynaTrace APM
 
Using dynaTrace to optimise application performance
Using dynaTrace to optimise application performanceUsing dynaTrace to optimise application performance
Using dynaTrace to optimise application performance
 
Dynatrace
DynatraceDynatrace
Dynatrace
 
From APM to Business Monitoring with AppDynamics Analytics
From APM to Business Monitoring with AppDynamics AnalyticsFrom APM to Business Monitoring with AppDynamics Analytics
From APM to Business Monitoring with AppDynamics Analytics
 

Similar to Webinar: Node.js Transaction Tracing & Root Cause Analysis with StrongLoop Arc

Linux Server Deep Dives (DrupalCon Amsterdam)
Linux Server Deep Dives (DrupalCon Amsterdam)Linux Server Deep Dives (DrupalCon Amsterdam)
Linux Server Deep Dives (DrupalCon Amsterdam)
Amin Astaneh
 
Getting Started With Spark Structured Streaming With Dustin Vannoy | Current ...
Getting Started With Spark Structured Streaming With Dustin Vannoy | Current ...Getting Started With Spark Structured Streaming With Dustin Vannoy | Current ...
Getting Started With Spark Structured Streaming With Dustin Vannoy | Current ...
HostedbyConfluent
 
Analysis of an exploited npm package
Analysis of an exploited npm packageAnalysis of an exploited npm package
Analysis of an exploited npm package
Parth Parmar
 
How To Configure SNMP Logging on RHEL 7
How To Configure SNMP Logging on RHEL 7How To Configure SNMP Logging on RHEL 7
How To Configure SNMP Logging on RHEL 7
VCP Muthukrishna
 
GopherCon IL 2020 - Web Application Profiling 101
GopherCon IL 2020 - Web Application Profiling 101GopherCon IL 2020 - Web Application Profiling 101
GopherCon IL 2020 - Web Application Profiling 101
yinonavraham
 
Pet Pen Testing Tools: Zenmap & Nmap
Pet Pen Testing Tools: Zenmap & NmapPet Pen Testing Tools: Zenmap & Nmap
Pet Pen Testing Tools: Zenmap & Nmap
Matt Vieyra
 
Getting Started with Spark Structured Streaming - Current 22
Getting Started with Spark Structured Streaming - Current 22Getting Started with Spark Structured Streaming - Current 22
Getting Started with Spark Structured Streaming - Current 22
Dustin Vannoy
 
Quest for the Perfect Workflow for McrFRED
Quest for the Perfect Workflow for McrFREDQuest for the Perfect Workflow for McrFRED
Quest for the Perfect Workflow for McrFRED
Andi Smith
 
Ceph Day Melbourne - Troubleshooting Ceph
Ceph Day Melbourne - Troubleshooting Ceph Ceph Day Melbourne - Troubleshooting Ceph
Ceph Day Melbourne - Troubleshooting Ceph
Ceph Community
 
Go Replicator
Go ReplicatorGo Replicator
Go Replicator
Joshua Drake
 
Gearman - Job Queue
Gearman - Job QueueGearman - Job Queue
Gearman - Job Queue
Diego Lewin
 
Control your service resources with systemd
 Control your service resources with systemd  Control your service resources with systemd
Control your service resources with systemd
Marian Marinov
 
OSTEP Chapter2 Introduction
OSTEP Chapter2 IntroductionOSTEP Chapter2 Introduction
OSTEP Chapter2 Introduction
Shuya Osaki
 
Ansible best practices
Ansible best practicesAnsible best practices
Ansible best practices
StephaneFlotat1
 
PL-4047, Big Data Workload Analysis Using SWAT and Ipython Notebooks, by Moni...
PL-4047, Big Data Workload Analysis Using SWAT and Ipython Notebooks, by Moni...PL-4047, Big Data Workload Analysis Using SWAT and Ipython Notebooks, by Moni...
PL-4047, Big Data Workload Analysis Using SWAT and Ipython Notebooks, by Moni...
AMD Developer Central
 
Award-winning technology: Oxid loves the query cache
Award-winning technology: Oxid loves the query cacheAward-winning technology: Oxid loves the query cache
Award-winning technology: Oxid loves the query cache
Ulf Wendel
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time Optimization
Kan-Ru Chen
 
"Master production-grade best practices to build your Node.js Docker images",...
"Master production-grade best practices to build your Node.js Docker images",..."Master production-grade best practices to build your Node.js Docker images",...
"Master production-grade best practices to build your Node.js Docker images",...
Fwdays
 
RAC-Installing your First Cluster and Database
RAC-Installing your First Cluster and DatabaseRAC-Installing your First Cluster and Database
RAC-Installing your First Cluster and Database
Nikhil Kumar
 
SAP LVM Customer Instances
SAP LVM Customer InstancesSAP LVM Customer Instances
SAP LVM Customer Instances
Gary Jackson MBCS
 

Similar to Webinar: Node.js Transaction Tracing & Root Cause Analysis with StrongLoop Arc (20)

Linux Server Deep Dives (DrupalCon Amsterdam)
Linux Server Deep Dives (DrupalCon Amsterdam)Linux Server Deep Dives (DrupalCon Amsterdam)
Linux Server Deep Dives (DrupalCon Amsterdam)
 
Getting Started With Spark Structured Streaming With Dustin Vannoy | Current ...
Getting Started With Spark Structured Streaming With Dustin Vannoy | Current ...Getting Started With Spark Structured Streaming With Dustin Vannoy | Current ...
Getting Started With Spark Structured Streaming With Dustin Vannoy | Current ...
 
Analysis of an exploited npm package
Analysis of an exploited npm packageAnalysis of an exploited npm package
Analysis of an exploited npm package
 
How To Configure SNMP Logging on RHEL 7
How To Configure SNMP Logging on RHEL 7How To Configure SNMP Logging on RHEL 7
How To Configure SNMP Logging on RHEL 7
 
GopherCon IL 2020 - Web Application Profiling 101
GopherCon IL 2020 - Web Application Profiling 101GopherCon IL 2020 - Web Application Profiling 101
GopherCon IL 2020 - Web Application Profiling 101
 
Pet Pen Testing Tools: Zenmap & Nmap
Pet Pen Testing Tools: Zenmap & NmapPet Pen Testing Tools: Zenmap & Nmap
Pet Pen Testing Tools: Zenmap & Nmap
 
Getting Started with Spark Structured Streaming - Current 22
Getting Started with Spark Structured Streaming - Current 22Getting Started with Spark Structured Streaming - Current 22
Getting Started with Spark Structured Streaming - Current 22
 
Quest for the Perfect Workflow for McrFRED
Quest for the Perfect Workflow for McrFREDQuest for the Perfect Workflow for McrFRED
Quest for the Perfect Workflow for McrFRED
 
Ceph Day Melbourne - Troubleshooting Ceph
Ceph Day Melbourne - Troubleshooting Ceph Ceph Day Melbourne - Troubleshooting Ceph
Ceph Day Melbourne - Troubleshooting Ceph
 
Go Replicator
Go ReplicatorGo Replicator
Go Replicator
 
Gearman - Job Queue
Gearman - Job QueueGearman - Job Queue
Gearman - Job Queue
 
Control your service resources with systemd
 Control your service resources with systemd  Control your service resources with systemd
Control your service resources with systemd
 
OSTEP Chapter2 Introduction
OSTEP Chapter2 IntroductionOSTEP Chapter2 Introduction
OSTEP Chapter2 Introduction
 
Ansible best practices
Ansible best practicesAnsible best practices
Ansible best practices
 
PL-4047, Big Data Workload Analysis Using SWAT and Ipython Notebooks, by Moni...
PL-4047, Big Data Workload Analysis Using SWAT and Ipython Notebooks, by Moni...PL-4047, Big Data Workload Analysis Using SWAT and Ipython Notebooks, by Moni...
PL-4047, Big Data Workload Analysis Using SWAT and Ipython Notebooks, by Moni...
 
Award-winning technology: Oxid loves the query cache
Award-winning technology: Oxid loves the query cacheAward-winning technology: Oxid loves the query cache
Award-winning technology: Oxid loves the query cache
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time Optimization
 
"Master production-grade best practices to build your Node.js Docker images",...
"Master production-grade best practices to build your Node.js Docker images",..."Master production-grade best practices to build your Node.js Docker images",...
"Master production-grade best practices to build your Node.js Docker images",...
 
RAC-Installing your First Cluster and Database
RAC-Installing your First Cluster and DatabaseRAC-Installing your First Cluster and Database
RAC-Installing your First Cluster and Database
 
SAP LVM Customer Instances
SAP LVM Customer InstancesSAP LVM Customer Instances
SAP LVM Customer Instances
 

Recently uploaded

Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
Roshan Dwivedi
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
Hironori Washizaki
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
Gerardo Pardo-Castellote
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
ISH Technologies
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
kalichargn70th171
 
Codeigniter VS Cakephp Which is Better for Web Development.pdf
Codeigniter VS Cakephp Which is Better for Web Development.pdfCodeigniter VS Cakephp Which is Better for Web Development.pdf
Codeigniter VS Cakephp Which is Better for Web Development.pdf
Semiosis Software Private Limited
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
mz5nrf0n
 

Recently uploaded (20)

Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
 
Codeigniter VS Cakephp Which is Better for Web Development.pdf
Codeigniter VS Cakephp Which is Better for Web Development.pdfCodeigniter VS Cakephp Which is Better for Web Development.pdf
Codeigniter VS Cakephp Which is Better for Web Development.pdf
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
 

Webinar: Node.js Transaction Tracing & Root Cause Analysis with StrongLoop Arc

  • 1. TRANSACTION TRACING & ROOT CAUSE ANALYSIS WITH STRONGLOOP ARC Jordan Kasper | Developer Evangelist
  • 2. STEP ONE The first step in monitoring, profiling, and tracing your Node application is to run it in a process manager!
  • 3. BUILD YOUR APP WITH SLC ~$ npm install ­g strongloop ~/my­app$ slc build ... ~/my­app$ ls ... ...  my­app­0.1.0.tgz
  • 4. INSTALL AND RUN STRONG PM On your deployment machine... ~$ npm install ­g strong­pm ~$ sl­pm­install
  • 5. DEPLOY TO STRONG PM From our development machine (or staging, etc)... ~/my­app$ slc deploy http+ssh://myserver.com:8701
  • 6. RUNNING LOCALLY If you need to profile things locally (your machine or a staging/testing server), run slc start from your app directory: ~/my­app$ slc start Process Manager is attempting to run app `.`.   To confirm it is started: slc ctl status tracing­example­app   To view the last logs: slc ctl log­dump tracing­example­app   ... Then start the Arc UI: ~/my­app$ slc arc
  • 7.
  • 10. AVAILABLE METRICS CPU Load (system) Heap Memory sage Event Loop Count Event Loop Tick Timing HTTP Connections Database Connections (Oracle, MySQL, Mongo, Postgres) Misc other modules (Redis, Memcache(d), Message queues)
  • 11. WHAT DO I LOOK FOR? CPU Usage is pretty obvious, just watach your high points! With Heap Memory Usage you want to see a "sawtooth" chart, each drop indicates garbage collection. No drop is bad!
  • 12. WHAT DO I LOOK FOR?
  • 13. WHAT DO I LOOK FOR? The two Event Loop metrics are opposed. You want the loop count to remain high under normal load (more ticks per metrics cycle is good). Any dips may be bad. The Loop timing, on the other hand, indicates how long event loop ticks are taking. Any spikes here are bad!
  • 14. SETUP METRICS COLLECTION On our production machine, with strong-pm installed, simply set the collection location: ~$ export STRONGLOOP_METRICS="log:/path/to/api­metrics.log" ~$ export STRONGLOOP_METRICS="syslog" ~$ export STRONGLOOP_METRICS="statsd://my­log­server.com:1234" ~$ export STRONGLOOP_METRICS="graphite://my­log­server.com:1234" ~$ export STRONGLOOP_METRICS="splunk://my­log­server.com:1234"
  • 15. SETUP METRICS COLLECTION Alternatively, on the production machine you can run: ~$ sl­pm­install ­­metrics <url> Or during runtime: ~$ slc ctl env­set my­app STRONGLOOP_METRICS=<url>
  • 17. PROFILING We can spot issues using the metrics being monitored, but now we need to find the cause of those issues. Profiling CPU usage and memory is the way to do this.
  • 21. PROGRAMMATIC MEMORY MONITORING If we have memory issues, it may be helpful to monitor memory usage dynamically. ~$ npm install heapdump ­­save var heapdump = require('heapdump'); var THRESHOLD = 500; setInterval(function () {     var memMB = process.memoryUsage().rss / 1048576;     if (memMB > THRESHOLD) {         process.chdir('/path/to/writeable/dir');         heapdump.writeSnapshot();     } }, 60000 * 5);
  • 22. MEMORY MONITORING Caution: Taking a heap snapshot is not trivial on resources. If you already have a memory problem, this could kill your process! Unfortunately sometimes you have no alternative.
  • 23. SMART PROFILING How can we using the monitoring to profile? "smart profiling" based on event loop blockage ~$ slc ctl cpu­start 1.1.49408 20 1. Monitors a specific worker (1.1.49408) 2. Event loop blocked for more than 20ms, start CPU profile 3. Stop profiling once event loop resumes
  • 24. FINDING THE WORKER ID ~$ slc ctl status Service ID: 1 Service Name: my­app Environment variables:   No environment variables defined Instances:     Version  Agent version  Cluster size      4.1.0       1.5.1            4 Processes:         ID      PID   WID  Listening Ports  Tracking objects?  CPU profilin     1.1.49401  49401   0     1.1.49408  49408   1     0.0.0.0:3001     1.1.49409  49409   2     0.0.0.0:3001     1.1.49410  49410   3     0.0.0.0:3001     1.1.49411  49411   4     0.0.0.0:3001
  • 26. DEEP TRANSACTIN TRACING Analyze performance of your application from a high level down to the function level.
  • 28. ANOMOLY INSPECTION See something off? Click on that point in the resource usage chart. (The orange triangles at the bottom identify anomolies betond three-sigma deviations.)
  • 30. TRACING WATERFALL By clicking on the "sync" line we can inspect the costs of the synchronous code.
  • 32. FLAME CHARTS The flame chart identifies each function in the call stack, organized in color by module. The size of the bar represents the total resource consumption for that function and all of its function calls. Clicking on a function shows that functions resource usage.
  • 33. LOOKING FOR MORE? Check out our blog post on Transaction Tracing and identifying a DoS attack! http://bit.ly/arc-tracing
  • 34. THANK YOU! QUESTIONS? Jordan Kasper | Developer Evangelist Join us for more events! strongloop.com/developers/events