Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Performance Tales of Serverless - CloudNative London 2018

107 views

Published on

Function-as-a-Service "serverless" cloud offerings provide you with a super easy way to run custom code in response to events. One promise of FaaS model is the ability to scale without limits, up or down, whenever needed. But how does that work in practice? Can AWS Lambda handle thousands of messages per second? How fast can Azure Functions scale up under sudden heavy load? What kind of latency can you expect from Google Cloud Functions? During this session Mikhail will share with you short tales, each of them teaching a lesson about practical scalability of serverless applications. You will also explore the steps to evaluate whether your application profile is suitable for serverless today.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Performance Tales of Serverless - CloudNative London 2018

  1. 1. Performance Tales of Serverless CloudNative London | September 28 | 2018
  2. 2. WHAT IS CloudNative? • • • • 2
  3. 3. EMBRACE THE CLOUD! EXPLOIT the inherent properties 3
  4. 4. 4 • • • • WHAT IS CloudNative?
  5. 5. Is this Cloud Native? Serverless Architecture
  6. 6. Welcome to CloudNative London 2018!
  7. 7. м 10 The Story …
  8. 8. 2012 2013 11
  9. 9. 12
  10. 10. What did we want? 13 $
  11. 11. 14
  12. 12. м 15 2017 2018
  13. 13. 16
  14. 14. What do we want? 17 $
  15. 15. 18 Function-as-a-Service Cloud Offerings
  16. 16. 19 Ideal Scalability: Throughput
  17. 17. Ideal Scalability: Latency 20
  18. 18. 21 Application Overview
  19. 19. OCCASIONAL USERS: MVP just launched, we get several visitors per hour 22
  20. 20. Visitors during sample 5 hours 23
  21. 21. Dependency Call Duration (ms) 24
  22. 22. Target End-to-End Latency (ms) 25
  23. 23. AWS Lambda Latency (ms) 26
  24. 24. Google Cloud Functions Latency (ms) 27
  25. 25. Azure Functions Latency (ms) 28
  26. 26. 29 Cold Start
  27. 27. 29 Warm Start
  28. 28. Subsequent Cold Starts after quiet periods 31
  29. 29. UNDERSTAND THE RUNTIME 1. Lesson Learned 32
  30. 30. COLD STARTS ARE SLOW(-ER) …and depend on language and package size 33 2. Lesson Learned
  31. 31. LOAD TESTING: How do we load test? With serverless! 34
  32. 32. Load Testing Setup 35
  33. 33. Load Testing Setup 36
  34. 34. Load Testing Setup 37
  35. 35. Serverless Artillery
  36. 36. BE CREATIVE IN USAGE SCENARIOS 39 3. Lesson Learned
  37. 37. PROJECTED LOAD: Simulated at the target amount of users 40
  38. 38. Requests/sec during 5 hours of load test 41
  39. 39. End-to-End Latency (ms) 42
  40. 40. End-to-End Latency (ms) 43
  41. 41. SERVERLESS SCALABILITY IS LIMITED BY 44 NON-SERVERLESS DEPENDENCIES 4. Lesson Learned
  42. 42. 45 SERVERLESS APPLICATION CAN DDOS ANY MERE MORTAL SERVICE 5. Lesson Learned
  43. 43. ETL: Asynchronous data processing 46
  44. 44. How to improve it 47
  45. 45. Serverless ETL 48
  46. 46. GCP Functions + Pub/Sub Processing 1 Million Points 49
  47. 47. Azure Functions + Event Hub Processing 1 Million Points 50
  48. 48. AWS Lambda + Kinesis Processing 1 Million Points 51
  49. 49. AWS Processing Speed per Reserved RAM 52 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
  50. 50. SERVERLESS IS NOT JUST HTTP EVENT BASED ASYNC FTW 53 6. Lesson Learned
  51. 51. 54 LEARN THE RESOURCE MODEL: LIMITS, SCALING MODE, RAM & CPU ALLOCATION 7. Lesson Learned
  52. 52. TV EFFECT: We are going to be live on TV!!! 55
  53. 53. Requests/sec during the load test 56
  54. 54. Azure Functions Response Percentiles (ms) 57
  55. 55. Azure Functions Response 99th Percentile (ms) 58
  56. 56. AWS Lambda Response Percentiles (ms) 59
  57. 57. Google Cloud Functions: Throttled 60
  58. 58. Google Cloud Functions: Persist Connections const http = require('http'); const agent = new http.Agent({keepAlive: true}); exports.mycloudfunction = (req, res) => { req = http.get({ host: '...', port: 80, path: '...', agent: agent }, // ... 61
  59. 59. Google Functions Response Percentiles (ms) 62
  60. 60. 63 REUSE CONNECTIONS, POOL & CACHE 8. Lesson Learned
  61. 61. SERVERLESS IS UNIQUELY SUITABLE FOR SPIKY LOAD… 64 BUT KNOW THE LIMITS 9. Lesson Learned
  62. 62. RUNNING IN PRODUCTION 65
  63. 63. 66 Actual Outcome • • • • 
  64. 64. DESIGN FOR SUCCESS BUT BE PREPARED TO 67 A FAILURE 10. Lesson Learned
  65. 65. Is Serverless Good for My Next Project? 68
  66. 66. 69 • • • • Is Serverless Good for My Next Project?
  67. 67. Perfect Scenarios for Serverless • • • • 70
  68. 68. Serverless Cold Start War

×