connect js nodejs_devops_shubhra
TRANSCRIPT
Triage, Diagnose & Scale Node.js
Shubhra Kar | Director – Productstwitter:@shubhrakar mail:[email protected]
Why am I here…or rather who sent me here ?
These guys sent me !
Bert Belder
Ben Noordhuis
Node Core
RaymondFeng
Ritchie Martori
LoopBack/Express Core
SamRoberts
Miroslav Bajtos
Ryan Graham
To do what ?
To give you a fresh pair of gloves
Pack a punch Nodies !
5
Express new website & docs
What are we trying to solve
Let’s touch up our SOA for Mobile…and
bring Glass @ work
Architect Developer
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 ?
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
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
Can Errors be stitched into a trace and recovered ?
Enter StrongLoop / Zones
How to diagnose CPU hotspots upto line of code ?
Enter StrongLoop / Node Profilerslc runctl cpu-start/stop PID
Can I visually see my hotspots ?
How about a fancy chart for my boss ?
Call Stack
Path and function
CPU Cycle times
Does Node have memory leaks ?
StrongLoop / HeapSnapshotsslc runctl heap-snapshot PID
Another fancy chart please
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
Ok…here is 24x7 monitoring
18
On-Premises / 3rd Party monitoring ?
• Graphite• Splunk• Datadog• Introscope• Others
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
Almost there …
Look I got monitoring
Architect The Boss
Good…but before I promote you, show me
some scale
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
Distributed scaling and deployment - Mesh
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
That’s how we win.
The Boss
hehe…I am a Node Hipster now !
Nodies are not just silicon valley hipsters !
And most recently….#1 Retailer
First there was Node
Thank you!
JUST WIN,BABY!