$30 off During Our Annual Pro Sale. View Details »

How cheap serverless realli is?

Yas
February 20, 2020

How cheap serverless realli is?

The most compelling reason for having a Serverless architecture is cost. In most cases this means that you only pay for the time your app is running which sounds great. Why would you want to pay for something while it's not even running?

However, sounds like things are not that simple nowadays. With Serverless comes a lot of side costs like storage, execution time, and sometimes even bandwidth consumed. In this talk we will break these down and show you how cost effective Serverless really is based on different numbers. It's going to be mind blowing, at least my mind was blown when I found out. So are you ready to be spoilt 😁?

Yas

February 20, 2020
Tweet

More Decks by Yas

Other Decks in Technology

Transcript

  1. How cheap
    Serverless really is?

    View Slide

  2. How cheap
    Serverless really is?

    View Slide

  3. Yas
    Developer Advocate @TelstraDev
    Lead consultant @ Te lstraP u rp le
    @yash in ts
    yash in ts.d e v
    /in /yash in ts

    View Slide

  4. @yashints

    View Slide

  5. @yashints
    Agenda
    ◂ History
    ◂ Com m on g rou n d s
    ◂ Costs on Azu re Fu n ction s
    ◂ Sim p le fu n ction s
    ◂ Larg e scale ap p s
    ◂ Costs on AW S Lam b d a
    ◂ Su m m ary

    View Slide

  6. History

    View Slide

  7. Containers
    Bare-metal VMs
    Hardware
    OS
    b in /lib b in /lib
    AP P 1 AP P 2
    Hard w are
    OS
    b in /lib b in /lib
    AP P 1 AP P 2
    OS1 OS2
    Hyp e rvisor
    Hard w are
    OS
    b in /lib b in /lib
    AP P 1 AP P 2
    Con tain e r e n g in e

    View Slide

  8. “ Software is a gas; it
    expands to fill its
    container.
    Nathan Myhrvold

    View Slide

  9. Common
    grounds
    @yashints

    View Slide

  10. @yashints

    View Slide

  11. ◂ Delegated infra management
    ◂ P ackag e d ap p s
    ◂ Can ru n in con tain e rs
    ◂ Han d lin g w orkload b y clon in g
    @yashints

    View Slide

  12. Benefits
    @yashints

    View Slide

  13. Pay for usage
    @yashints

    View Slide

  14. @yashints

    View Slide

  15. Breaking it down
    ◂ # of Executions
    ◂ Exe cu tion tim e
    ◂ Storag e
    @yashints

    View Slide

  16. Cost
    @yashints

    View Slide

  17. Free
    Seems free to me
    0.20 $
    Per 1,000,000
    Eve ry se con d - e ve ry d ay = 2,628,0 0 0
    < 4 0 c
    @yashints
    First 1,0 0 0 ,0 0 0

    View Slide

  18. Gb-s
    Rounded to nearest 128MB
    First 4 0 0 K fre e
    Execution time ↑ 100ms
    25MB => 128MB => 0.125
    GB-s
    @yashints

    View Slide

  19. Hello world
    Every second every day
    Free
    2,628,000 * 0.100 = 262,800
    @yashints
    262,80 0 * .125 = 32,850 Gb -s

    View Slide

  20. Storage
    Azure - $0 .0 275 p /GB => First TB
    AW S - $0 .0 23 p /GB => First TB
    GCP – 5 GB p /m fre e - $0 .0 26 p /GB
    Free
    @yashints

    View Slide

  21. Real life example
    @yashints

    View Slide

  22. @yashints
    Facebook
    510K ❤ - 293K status – 136K photos
    939,000 * 60 * 60 * 24 * 30 = 2.43389e12
    0 .20 c * (2.4 3389e 12 – 1,0 0 0 ,0 0 0 fre e )

    View Slide

  23. @yashints
    Execution
    $486,777.40 p/m

    View Slide

  24. Execution time
    Comment
    < 1
    s
    Photo
    Several?
    Status
    1s
    1 second average

    View Slide

  25. @yashints
    Facebook
    2.43389e12 * 1
    2.43389e12 * .125 = 3.04236e11 GB
    -s
    (3.0 4 236e 11 – 4 0 0 ,0 0 0 ) * 0 .0 0 0 0 16

    View Slide

  26. @yashints
    Execution time
    $4,867,769.60 p/m

    View Slide

  27. @yashints
    Total
    $5,354,547 p/m

    View Slide

  28. But, there is more
    @yashints

    View Slide

  29. @yashints
    First 5GB free
    8.7c p GB – 10TB
    and goes down

    View Slide

  30. @yashints
    Total
    ?
    > 5.3M

    View Slide

  31. A typical app
    @yashints

    View Slide

  32. @yashints

    View Slide

  33. @yashints

    View Slide

  34. AWS
    ◂ 128MB
    ◂ 211K p /m
    ◂ 20 0 MS
    @yashints
    Free

    View Slide

  35. AWS - Facebook
    ◂ 128MB
    ◂ 2.4 3389e 12 p /m
    ◂ 1S
    @yashints
    $5,557.380.87

    View Slide

  36. Thanks!
    Any questions?
    ◂ @yash in ts
    ◂ h ttp s://yash in ts.d e v

    View Slide