Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Serverless Measurement Limits

Serverless Measurement Limits

Exploring cold starts and warm starts in serverless compute platforms.

Expanded version of the 2017 dotScale talk, "Searching for the Server in Serverless"

Clay Smith

May 05, 2017

More Decks by Clay Smith

Other Decks in Programming


  1. SERVERLESS MEASUREMENT LIMITS @smithclay New Relic Based on my dotScale

    2017 talk: "Searching for the Server in Serverless"
  2. λ HTTP Requests Client App App Architecture with FaaS Functions

    + API Gateway Is this going to (not) work for me? Managed Infrastructure λ λ λ
  3. Is your λ triggered by user interaction? Yes No Monitor

    & make it fast (> 100ms) Monitor & still make it fast-ish
  4. Cold Start vs Warm Start Event Trigger Handler Warm Function

    Invocation Time Create Initialize Handler Cold
  5. λ Running Commands const exec = require('child_process').exec; exports.handler = (trigger,

    cb) => { exec('whoami', (err, stdout) => { console.log(stdout); return cb(null); }); } [LOG TIME] sbxuser_1066
  6. Go as a SSH Server + Tunnel-er Copy and paste

    Go SSH server + tunnel code (no inbound connections allowed) Execute binary on trigger Max(λ timeout)
  7. Aside: Old But Still Good Advice λ Cloud vendor code

    "Secret Sauce Library" Keep it portable Write short handlers
  8. Info from /proc 2x Intel(R) Xeon(R) CPU E5-2666 v3 @

    2.90GHz cat /proc/cpuinfo 3857664 kB cat /proc/meminfo ixgbevf (EC2 10Gbps Network Driver) cat /proc/modules c4.large EC2 Compute-Optimized Instance (?)
  9. c4.large instance λ λ λ λ λ λ λ λ

    λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λs in theory on a VM 10 Gbps λ = 128 MB Function λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ λ
  10. Cold Start Discovery in Code var SO_SO_COLD = true; exports.handler

    = function(trigger, cb) { console.log('Cold? %s', SO_SO_COLD); SO_SO_COLD = false; return callback(cb) } https://github.com/smithclay/lambda-proc-info
  11. Serverless, in brief High availability (multi-AZ or region) Elastic VMs

    and Automagic Freezing Containers Really good scheduling algorithm
  12. FaaS Production Reality λ λ Dev Prod Orchestration (!?) Version/Deploy

    Monitoring Security Cold Start Mgmt The "learning cliff" Great tweet from @mfdii
  13. FaaS Isn't a Silver Bullet "I've got a quick, computationally-intensive

    task that I need to perform occasionally in response to a well-defined event that isn't that sensitive to latency." —The Ideal FaaS Developer // TO DO: measure && share