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

Money-saving tips for the frugal serverless developer

Yan Cui
April 30, 2024

Money-saving tips for the frugal serverless developer

Join us in this insightful session as we dive into the world of serverless architectures and explore common cost mistakes and learn actionable tips for cutting down wastes and reducing your AWS bill.

Whether you're looking to cut down on CloudWatch costs or improve cost-efficiency for your serverless application, we've got some helpful tips, just for you.

Yan Cui

April 30, 2024
Tweet

More Decks by Yan Cui

Other Decks in Technology

Transcript

  1. How to keep CloudWatch Logs cost under control 1. Do

    structured logging. DEBUG INFO WARN ERROR Detailed events for debugging application. General information that highlights progress of application. Potential problems, but doesn’t stop application from working. Issues that require immediate attention.
  2. How to keep CloudWatch Logs cost under control 1. Do

    structured logging. Log at INFO or above in production. DEBUG INFO WARN ERROR Detailed events for debugging application. General information that highlights progress of application. Potential problems, but doesn’t stop application from working. Issues that require immediate attention.
  3. How to keep CloudWatch Logs cost under control 1. Do

    structured logging. Log at INFO or above in production. 2. Sample DEBUG logs in production. e.g. 5% of invocations.
  4. How to keep CloudWatch Logs cost under control 1. Do

    structured logging. Log at INFO or above in production. 2. Sample DEBUG logs in production. e.g. 5% of invocations. 3. Set log retention to 30 days.
  5. CloudWatch Logs AWS Lambda AWS Lambda stdout asynchronously invokes any

    log aggregation service double paying for logs
  6. ?

  7. ? ?

  8. Law I. Make Cost a Non-functional Requirement. Law II. Systems

    that Last Align Cost to Business. Law III. Architecting is a Series of Trade-offs. Law IV. Unobserved Systems Lead to Unknown Costs. Law V. Cost Aware Architectures Implement Cost Controls. Law VI. Cost Optimization is Incremental. Law VII. Unchallenged Success Leads to Assumptions.
  9. Law I. Make Cost a Non-functional Requirement. Law II. Systems

    that Last Align Cost to Business. Law III. Architecting is a Series of Trade-offs. Law IV. Unobserved Systems Lead to Unknown Costs. Law V. Cost Aware Architectures Implement Cost Controls. Law VI. Cost Optimization is Incremental. Law VII. Unchallenged Success Leads to Assumptions.
  10. IOT core AppSync API Gateway Messages Connection Time $2 per

    million $0.08 per million mins $0.25 per million mins $1 per million $0.08 per million mins $1 per million
  11. IOT core AppSync API Gateway Messages Connection Time $2 per

    million $0.08 per million mins $0.25 per million mins $1 per million $0.08 per million mins $1 per million Momento - - Data Transfer $0.5 / GB EC2 rates EC2 rates EC2 rates
  12. ? ?

  13. ? ?

  14. Have to write Lambdaliths (No per-endpoint metrics & alerts, no

    fi ne-grained access control, no per-endpoint auth)
  15. Have to write Lambdaliths (No per-endpoint metrics & alerts, no

    fi ne-grained access control, no per-endpoint auth) (Large frameworks a ff ect cold start performance)
  16. 1. Billing alarms 2. Keeping monitoring cost under control 3.

    No Lambda-to-Lambda calls 4. Caching 5. Route53 TTL 6. Choosing the right service 7. Simplify your architecture 8. Function URLs 9. Functionless 10.No API
  17. productionreadyserverless.com Join 20+ AWS Heroes & Community Builders and 1000+

    happy students in levelling up your serverless game.
  18. “You could spend tens of thousands on costly mistakes, and

    years of dev time to learn these lessons, or you could spend a few days downloading Yan's extensive experience. The choice is clear!”