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

What I forgot to consider when changing into serverless with Lambda

What I forgot to consider when changing into serverless with Lambda

This is JAWS PANKRATION 2021's slide.
日本語版はこちらにあります。

Yasuhiro Matsuda

November 21, 2021
Tweet

More Decks by Yasuhiro Matsuda

Other Decks in Technology

Transcript

  1. What I forgot to consider when changing into
    serverless with Lambda
    JAWS-UG Kanazawa
    Yasuhiro Matsuda

    View Slide

  2. Introduce myself
    I was infrastructure engineer at a printing company
    in Kanazawa until 2020 that did proof-of-concept of
    infrastructure using AWS, transferred jobs to East
    Co., Ltd. in January 2021.
    I am also contributing to JAWS-UG since 2018 as a
    core member of the JAWS-UG Kanazawa chapter.
    And, I am active as a financial planner (AFP).
    My hobbies are running, bowling and grow
    vegetables.
    #jawsug_kanazawa

    View Slide

  3. #jawsug_kanazawa

    View Slide

  4. What’s Kanazawa Chaptor?
    We hold study sessions every month, mainly in
    Kanazawa, Ishikawa Prefecture.
    We want the following people to join us!
    #jawsug_kanazawa
    ・Interested in AWS
    ・Want to make more
    use of AWS
    ・Want to find friends
    who are using AWS
    We held AWS Community Day Kanazawa in 2019!

    View Slide

  5. Today's goals
    Understand the pitfalls and countermeasures
    in Lambda that can easily realize serverless.
    Understand about Lambda cold start and
    throttling.

    View Slide

  6. Today's talk
    ・Overview of serverless services
    ・What pit did I fall into?
    ・What should We do?

    View Slide

  7. Introduction of the contents of this service
    ・DONGRI which provided by East Co., Ltd. is dictionary application
    and can be used from a wide lineup of various dictionaries and
    glossaries.
    ・DONGRI offers iOS, Android, and
    Windows versions, and can be used
    through multiple devices, and can be
    used not only online but also offline.
    ・One word can be searched through
    multiple dictionaries.

    View Slide

  8. Service features
    ・Mainly used at school and at home
    ・Often used during the daytime on weekdays and at night
    ・Often used all at once in class, so momentary peaks are
    likely to occur

    View Slide

  9. Architecture before migration
    Simple
    configuration to
    connect multiple
    EC2s to a load
    balancer and
    distribute the load

    View Slide

  10. Old architectural challenges
    ・Not expandable, and the cost of maintaining a redundant
    configuration remains high
    ・ There is a possibility that the service will be stopped in the
    event of an AZ failure
    (The instance is built only in ap-northeast-1b)
    ・ High maintenance cost for Windows Server based system
    ・ It is difficult to maintain the original database in EC2

    View Slide

  11. Updated architecture
    Reduce maintenance costs by configuring to
    scale with a configuration using Lambda and
    DocumentDB and migrating to managed
    services.
    For dictionaries that have not been migrated to
    DocumentDB due to the migration transition
    period, the request is forwarded to the
    conventional system and searched.

    View Slide

  12. What's happened?
    ・A 502 error occurred during the load test. After
    investigating the cause, it was due to exceeding the number
    of concurrent executions, which is the default of 1000.

    View Slide

  13. We applied for mitigation
    We intended to solve
    the problem by applying
    for relaxation from 1000
    to 5000 simultaneous
    executions of accounts!

    View Slide

  14. But...
    When I did a server load test, I got a different error. After
    investigating the cause, it was found that throttling had occurred.

    View Slide

  15. About Throttles

    View Slide

  16. About Throttles

    View Slide

  17. What should We do?
    ・Reduce process time
    → Avoid cold start and use Provisioned Concurrrency Setteings
    ex. serverless-provisioned-concurrency-autoscaling

    View Slide

  18. What’s cold start?

    View Slide

  19. What should We do?
    ・It is important to adopt a configuration that can
    withstand spikes
    ・Let's see ”Amazon ECS &
    Docker operational
    knowledge to handle large-
    scale load of Roma Saga
    RS”

    View Slide

  20. Conclusion
    ・Understand the characteristics of the
    architecture to be adopted
    ・Consider load testing during PoC
    ・Read the documentation carefully
    ・Let's see the use case!

    View Slide

  21. Thank you!
    JAWS-UG Kanazawa
    Yasuhiro Matsuda

    View Slide