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

Serverless Performance with Headless Chrome

Clay Smith
October 10, 2017

Serverless Performance with Headless Chrome

The number of people running interesting binaries in AWS Lambda is increasing, and with the recent release of Headless Chromium—a version of the Chrome browser that can run without a UI—there have been experiments and different open-source projects of individuals running it inside an AWS Lambda environment. Running a large, memory-intensive piece of software designed for desktops inside a serverless function presents interesting performance challenges, including how to minimize cold start time and how to optimize the right amount of memory for the function.

This talk is about optimizing performance of chromium inside Lambda using multiple data sources, including AWS X-Ray traces and custom metrics. While the talk is focused on headless chrome in AWS Lambda, the performance techniques can be applied to any memory or compute-intensive serverless functions.

Clay Smith

October 10, 2017
Tweet

More Decks by Clay Smith

Other Decks in Programming

Transcript

  1. SERVERLESS PERF STRATEGY ƛ ƛ is it fast? ƛ ƛ

    is it fast concurrently? ƛ ƛ what's the worst case? why?
  2. VISUALIATING TRACES IN AGGREGATE 1) How long does it take

    for my function to initialize? 2) Where is time generally being spent?
  3. FOR THIS FUNCTION, COLD STARTS ARE RARE Over a 24

    hour period, the function rarely experiences cold starts.
  4. WRAP UP • Collect data for several days for many

    function runs. • Consider enabling x-ray traces for non-trivial functions • Test scenarios where your function has many concurrent executions (i.e. large spike in the number of requests) • Don't be afraid to increase memory: it might end up costing less. •Measure and share!