contact
play

Contact v.kazulkin@iplabs.de Vadym Kazulkin ip.labs GmbH - PowerPoint PPT Presentation

Contact v.kazulkin@iplabs.de Vadym Kazulkin ip.labs GmbH xing.com/profile/Vadym_Kazulkin @VKazulkin @ServerlessBonn (Meetup) Christian Bannes c.bannes@iplabs.de ip.labs GmbH xing.com/profile/Christian_Bannes Ip.labs GmbH To FaaS...


  1. Contact v.kazulkin@iplabs.de Vadym Kazulkin ip.labs GmbH xing.com/profile/Vadym_Kazulkin @VKazulkin @ServerlessBonn (Meetup) Christian Bannes c.bannes@iplabs.de ip.labs GmbH xing.com/profile/Christian_Bannes

  2. Ip.labs GmbH

  3. To FaaS... …or not to FaaS

  4. Function as a Service = AWS Lambda Image: https://aws.amazon.com/de/lambda/features

  5. Serverless is more than Function as a Service Image: https://aws.amazon.com/de/lambda/features

  6. Typical Three-Tier Image: https://www.infoq.com/articles/serverless-sea-change/

  7. Function as a Service Image: https://www.infoq.com/articles/serverless-sea-change/

  8. Serverless Applications Image: https://www.infoq.com/articles/serverless-sea-change/

  9. Infrastructure cost Image: https://stocksnap.io

  10. Velocity of your team Image: https://burst.shopify.com

  11. What you really have to consider Total Cost of Ownership

  12. Lambda pricing model

  13. Cost for lambda REQUEST DURATION

  14. Request Tier $ 0.20 Per 1 Mio Requests

  15. Duration Tier $ 0.00001667 Per GB-Second

  16. GB-Second ONE SECOND ONE GB

  17. Example • 1 Mio requests Requests: • Lambda with 512MiB $0.20 • Each lambda takes 200ms GB-Seconds: 0.5 GiB * 0.2 sec * 1 Mio $1.67 = 100 000 GB-Seconds

  18. Cost scales linearly with memory

  19. How does this compare to VM pricing model?

  20. EC2 Instance Families Lambda performance compares to • M4 (general purpose) • M5 (general purpose)

  21. M5 General Purpose Instance Cost scales linearly with memory

  22. Lamdba vs VM https://www.youtube.com/watch?v=b1ebYEfQX1s

  23. Lambda compute is 5x more expensive than M5

  24. Threading Model Idle Idle Pay per wall clock time Pay per use

  25. AWS monetizes the datacenter… … by selling time on their servers Image: https://aws.amazon.com

  26. Common pitfalls when working with lambda

  27. More memory = more expensive?

  28. Power tuning lambda • Executes different settings in parallel • Outputs the optimal setting Image: https://github.com/alexcasalboni/aws-lambda-power-tuning

  29. Paying for wait time Image: https://blog.binaris.com/lambda-pricing-pitfalls/

  30. The reality is… Lambda is often just a small percentage of your total cost

  31. Api Gateway $ 3.50 Per million API calls

  32. Event Sources • SQS and SNS are charged for requests • Kinesis charges for shard hours & PUT requests Image: https://blog.binaris.com/lambda-pricing-pitfalls/

  33. Event Sources • Cost for Kinesis grows with slower rate • Attractive at to operate at scale Image: https://blog.binaris.com/lambda-pricing-pitfalls/

  34. DynamoDB On-Demand Image: https://aws.amazon.com/blogs/aws/amazon-dynamodb-on-demand-no-capacity-planning-and-pay-per-request-pricing/

  35. Provisioned vs On-Demand • Use On-Demand for spiky workloads • Use Provisioned for constantly high workload

  36. Cost saving with On-Demand Switch to "On-Demand" Image: https://twitter.com

  37. Example 100 API requests per second 24/7 • API Gateway • Load balancer • Lambda with 1GB and • 3 x M5.xlarge with 300ms per request 16GB each $2400 / Month $520 / Month

  38. Serverless vs VM • "Pay as you go" can significantly reduce server cost because you don’t pay for ide time • For serverless you need right architecture • Consider the Total Cost of Ownership

  39. What you really have to consider: Total Cost of Ownership

  40. Ajay Nair (https://twitter.com/ajaynairthinks/status/1057696133076541441)

  41. TCO Full Picture Auto Scaling Built in No Infrastructure Fewer Engineers Maintanence Required Faster Time to Lower Technical Market Debt Focus on Business Value & Innovation Forrest Brazeal „The Business Case For Serverless” https://www.trek10.com/blog/business-case-for-serverless/

  42. Do more with (Server-)less

  43. FaaS... … or not to FaaS ?

  44. Image: https://stock.adobe.com

  45. Decision Checklist 1. Application lifecycle 2. Workloads 3. Platform limitations 4. Cost at scale 5. Operational constraints 6. Organizational knowledge

  46. Understand Application lifecycle Christian Posta „Be as serverless as you can, but not more than that” https://blog.christianposta.com/serverless/its-not-about-microservices-vs-serverless/

  47. Explore phase • Quickly validate hypotheses • Rapidly experiment • Run experiments as cheaply as possible Serverless is a perfect fit Image: burst.shopify.com/photos/a-look-across-the-landscape-with-view-of-the-sea

  48. Exploit phase • Built something that does provide customer value • Build it on scale • Build a profitable product around it partly serverless and partly not serverless architecture Image: Robert Scoble via Flickr

  49. Application lifecycle • How much of my stack should I own to be able to deliver business value? • Outsource SLA, regulatory compliance, price, and roadmap to my service provider?

  50. Existing applications • You can’t magically move that all off to service providers • You can try to modernize parts of them

  51. Strangler Pattern • Add a proxy (API Gateway or Application Loadbalancer), which sits between the legacy application and the user • Add new services and link it to the proxy Marin Fowler „StrangerFigApplication” https://martinfowler.com/bliki/StranglerFigApplication.html

  52. FinDev Concept Activity-based costing on a digital operation-by-operation basis • Figure out features which deliver business value comparing to their cost Aleksander Simovic & Mark Schwarz „FinDev and Serverless Microeconomics: Part 1” https://aws.amazon.com/de/blogs/enterprise-strategy/findev-and-serverless-microeconomics-part-1/

  53. 1. Application lifecycle 2. Workloads 3. Platform limitations 4. Cost at scale 5. Operational constraints imposed by other dependencies 6. Organizational knowledge

  54. Understand your workloads • Event-driven • API-driven • Batch Job • ML/AI • Big Data Image: flickr.com/photos/everywhereatonce/294789504

  55. Lambda Layers & Lambda Runtime API Door opener for use case like: • Big Data • ML/AI

  56. Understand your workloads • Do we need to access specialized hardware ? • GPU access required? • Another RAM/CPU ratio? • Do we need constantly high performance? • Response time below 100 ms (e.g. bidding or gaming platforms) “A Berkeley View on Serverless Computing” https://www2.eecs.berkeley.edu/Pubs/TechRpts/2019/EECS-2019-3.html

  57. Understand your workloads • Do we need high throughput ? • Lambda‘s network bandwidth is limited (an order of magnitude lower than a single modern SSD) shared between all functions packed on the same VM “A Berkeley View on Serverless Computing” https://www2.eecs.berkeley.edu/Pubs/TechRpts/2019/EECS-2019-3.html

  58. Storage TradeOffs Scaling Pricing Latency Consistency “A Berkeley View on Serverless Computing” https://www2.eecs.berkeley.edu/Pubs/TechRpts/2019/EECS-2019-3.html

  59. S3 Storage TradeOffs Scaling Pricing Latency Consistency “A Berkeley View on Serverless Computing” https://www2.eecs.berkeley.edu/Pubs/TechRpts/2019/EECS-2019-3.html

  60. The State of Serverless Computing “Chenggang Wu & Vikram Sreekanti - The State of Serverless Computing” Craft Conference 2019 - Budapest , Hungary https://www.youtube.com/watch?v=htLQiSPMUmk&list=LLYgjRSI2oCzI9eooyFrWR7A&index=6

  61. Understand your workloads • Do functions need to communicate with each other? • functions are not directly network accessible, they must communicate via an intermediary service “A Berkeley View on Serverless Computing” https://www2.eecs.berkeley.edu/Pubs/TechRpts/2019/EECS-2019-3.html

  62. 1. Application lifecycle 2. Workloads 3. Platform limitations 4. Cost at scale 5. Operational constraints imposed by other dependencies 6. Organizational knowledge

  63. Understand platform limitations • Cold start • Lambda with and without VPC for each runtime

  64. Ajay Nair „Become a Serverless Black Belt” https://www.youtube.com/watch?v=oQFORsso2go

  65. Ajay Nair „Become a Serverless Black Belt” https://www.youtube.com/watch?v=oQFORsso2go

  66. Lambda in VPC Chris Munns "Announcing improved VPC networking for AWS Lambda functions" https://aws.amazon.com/de/blogs/compute/announcing-improved-vpc-networking-for-aws-lambda-functions/

  67. Lambda in VPC As function’s execution environment scales • More network interfaces are created and attached to the Lambda infrastructure. • The exact number of network interfaces created and attached is a factor of your function configuration and concurrency. Chris Munns: "Announcing improved VPC networking for AWS Lambda functions” https://aws.amazon.com/de/blogs/compute/announcing-improved-vpc-networking-for-aws-lambda-functions/

Recommend


More recommend