Skip to content

Instantly share code, notes, and snippets.

@christopher-caldwell
Created April 29, 2021 23:41
Show Gist options
  • Save christopher-caldwell/4c04b887f526e106f23ecc59e258dd28 to your computer and use it in GitHub Desktop.
Save christopher-caldwell/4c04b887f526e106f23ecc59e258dd28 to your computer and use it in GitHub Desktop.
Lambda vs ECS

Lambda vs ECS

Lambda

Steps

  • Develop Code
  • Publish Lambda, code lives in S3

Limits

1000 concurrent req limit 15 min run time

Cold Start 1ms - 10s ( 30s max )

  • Lambda Invoked for the first time ( not hot )
  • Download from S3
  • Copy code from S3 into Language (node 10, 12, 14, Python, C++, Java, Go, Ruby ) Docker container

Invocation

  • node ./code/thingYouDontSee.js
  • ..............................
  • $
  • return handler(event, context, callback)
  • $
  • .......................
  • $
  • return handler(event, context, callback)
  • $
  • .........................
  • 5 min has elapsed
  • If !reservedConcurrency -> Container kill.

Fargate

  • Develop code
  • Push whole container into ECR ( registry )
  • Push container into the task

Limit

  • Throttled 10 invocations/s

Cold Start - 20-30s

  • Task Executed
  • Container ready to be executed

Invocation

No time limit Writable file system

  • $$
  • Run code in container
  • Exit
  • $$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment