connect js nodejs_devops_shubhra

26
Triage, Diagnose & Scale Node.js Shubhra Kar | Director – Products twitter:@shubhrakar mail:[email protected]

Upload: shubhra-kar

Post on 20-Aug-2015

376 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Connect js nodejs_devops_shubhra

Triage, Diagnose & Scale Node.js

Shubhra Kar | Director – Productstwitter:@shubhrakar mail:[email protected]

Page 2: Connect js nodejs_devops_shubhra

Why am I here…or rather who sent me here ?

Page 3: Connect js nodejs_devops_shubhra

These guys sent me !

Bert Belder

Ben Noordhuis

Node Core

RaymondFeng

Ritchie Martori

LoopBack/Express Core

SamRoberts

Miroslav Bajtos

Ryan Graham

Page 4: Connect js nodejs_devops_shubhra

To do what ?

To give you a fresh pair of gloves

Pack a punch Nodies !

Page 5: Connect js nodejs_devops_shubhra

5

Express new website & docs

Page 6: Connect js nodejs_devops_shubhra

What are we trying to solve

Let’s touch up our SOA for Mobile…and

bring Glass @ work

Architect Developer

Page 7: Connect js nodejs_devops_shubhra

So what’s the touchiness around Node

I recommend Node.js for

our API strategy

Architect The Boss

I heard Node is nerdy !...u sure our

developers know what’s cooking ?

Page 8: Connect js nodejs_devops_shubhra

8

Node.js apps actually have a life cycle

Compose

Deploy / Scale

Monitor

Secure / Manage

API Studio Controller StrongOps API Gateway

Development Production

Reliable API Solutions powered by Node.js

Page 9: Connect js nodejs_devops_shubhra

Let’s start by debugging

• Chrome debugger

• Debug Remotely on Production

• Breakpoints & uncaught exceptions

• Source Maps

• Unit test integration

• Display/edit variables

• Pre-loaded breaks

Known as Node-Inspector / StrongLoop-Debug

Page 10: Connect js nodejs_devops_shubhra

Can Errors be stitched into a trace and recovered ?

Enter StrongLoop / Zones

Page 11: Connect js nodejs_devops_shubhra

How to diagnose CPU hotspots upto line of code ?

Enter StrongLoop / Node Profilerslc runctl cpu-start/stop PID

Page 12: Connect js nodejs_devops_shubhra

Can I visually see my hotspots ?

Page 13: Connect js nodejs_devops_shubhra

How about a fancy chart for my boss ?

Call Stack

Path and function

CPU Cycle times

Page 14: Connect js nodejs_devops_shubhra

Does Node have memory leaks ?

StrongLoop / HeapSnapshotsslc runctl heap-snapshot PID

Page 15: Connect js nodejs_devops_shubhra

Another fancy chart please

Page 16: Connect js nodejs_devops_shubhra

We are getting there…

See we have great Dev

Tools

Architect The Boss

Yeah…But don’t wake me 3:00 a.m. in the night….Show me its

Production ready

Page 17: Connect js nodejs_devops_shubhra

Ok…here is 24x7 monitoring

Page 18: Connect js nodejs_devops_shubhra

18

On-Premises / 3rd Party monitoring ?

• Graphite• Splunk• Datadog• Introscope• Others

Page 19: Connect js nodejs_devops_shubhra

And On-Demand Dynamic Instrumentation

Agent AppMonkeyPatching

Agent AppDynamicInstrument

• Live Edit

• Line Level Instrumentation

• Any package, any framework, any code

• Custom logic

• Counters, Gauges and Timers

• HA rollback

Page 20: Connect js nodejs_devops_shubhra

Almost there …

Look I got monitoring

Architect The Boss

Good…but before I promote you, show me

some scale

Page 21: Connect js nodejs_devops_shubhra

Vertical and pseudo-horizontal scaling - Controller

CPU Core 1Worker

1

CPU Core 2 Worker2

CPU Core 2 Workern

Master

Cluster-Store / Redis Memcache (State Mgmt.)

• SSL Termination• Load Balancing• Routing

Databases

Services (SOAP/REST)

http

http

Nginx /HAProxy

• Bare Metal• Virtual Machine

Controller

Controller

Controller

Controller

Agent

Agent

Agent

Agent

Page 22: Connect js nodejs_devops_shubhra

Distributed scaling and deployment - Mesh

Page 23: Connect js nodejs_devops_shubhra

Log Aggregation - Controller

CPU Core 1Worker

1

CPU Core 2 Worker2

CPU Core 2 Workern

Master

Splunk Server

Controller

Controller

Controller

Controller

Worker 1 Log

Worker 2 Log

Worker n Log

Aggregated

Log

System Log

Aggregated

Splunk UniversalForwarder

API Events and Metrics

Page 24: Connect js nodejs_devops_shubhra

That’s how we win.

The Boss

hehe…I am a Node Hipster now !

Page 25: Connect js nodejs_devops_shubhra

Nodies are not just silicon valley hipsters !

And most recently….#1 Retailer

Page 26: Connect js nodejs_devops_shubhra

First there was Node

Thank you!

JUST WIN,BABY!