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

LDNWebPerf April 2017 - Andy Still

LDNWebPerf April 2017 - Andy Still

Serverless is the latest buzzword sweeping the industry but what is it and more importantly, how does it perform?

More Decks by London Web Performance Group

Other Decks in Technology

Transcript

  1. Andy Still : Technical Director & Founder, Intechnica Web: www.intechnica.co.uk

    Email: [email protected] Twitter: @andy_still / @intechnica Blog: http://www.internetperformanceexpert.com/ http://www.intechnica.co.uk/web-performance-warrior.aspx http://oreil.ly/2cJLxZh http://oreil.ly/2ce2ghE
  2. A standalone piece of code that runs in a shared

    infrastructure Code is managed and deployed as individual functions Triggered by external events
  3. A standalone piece of code that runs in a shared

    infrastructure You are only responsible for your code – the environment is outside your control No control over compute resources used You specify the amount of memory you want assigned to your function
  4. Benefits No servers to manage Code scales to your requirements

    Can execute many times in parallel Only pay for execution time Tracked down to nearest 100ms Isolation of functionality
  5. Triggers Other AWS services S3 Dynamo DB Kinesis SNS Cloudwatch

    External requests Via AWS API Gateway E.g. triggered from website Scheduled Proactive or reactive
  6. All functions have to be written to be idempotent -

    no cached data or files - no connection pooling
  7. Environment has to be re- created after period of no

    activity or if underlying infrastructure needs to expand under load.
  8. Memory is the only dial available – adjusting memory also

    adjusts the CPU and other server settings
  9. Example: Low memory, High CPU task Task: In local testing,

    uses <50mb of memory https://serverless.zone/my-accidental-3-5x-speed-increase-of-aws-lambda-functions-6d95351197f3#.q18h6eg9k
  10. Example: Low memory, High CPU task REPORT Duration: 2120.67 ms

    Billed Duration: 2200 ms Memory Size: 128 MB REPORT Duration: 2778.51 ms Billed Duration: 2800 ms Memory Size: 128 MB REPORT Duration: 2185.11 ms Billed Duration: 2200 ms Memory Size: 128 MB REPORT Duration: 1883.18 ms Billed Duration: 1900 ms Memory Size: 128 MB REPORT Duration: 353.52 ms Billed Duration: 400 ms Memory Size: 1536 MB REPORT Duration: 340.44 ms Billed Duration: 400 ms Memory Size: 1536 MB REPORT Duration: 356.91 ms Billed Duration: 400 ms Memory Size: 1536 MB REPORT Duration: 280.49 ms Billed Duration: 300 ms Memory Size: 1536 MB REPORT Duration: 336.75 ms Billed Duration: 400 ms Memory Size: 1536 MB Before: After: Increasing memory improved performance 7x
  11. Response Time Under Load Azure Functions Google Cloud AWS Lambda

    http://cloudacademy.com/blog/microsoft-azure-functions-vs-google-cloud-functions-fight-for-serverless-cloud-domination-continues/
  12. Andy Still : Technical Director & Founder, Intechnica Web: www.intechnica.co.uk

    Email: [email protected] Twitter: @andy_still / @intechnica Blog: http://www.internetperformanceexpert.com/ http://www.intechnica.co.uk/web-performance-warrior.aspx http://oreil.ly/2cJLxZh http://oreil.ly/2ce2ghE