1

Recently we moved to AWS. and we are in process of refactoring our code to take advantage of AWS offerings. one such thing is AWS Lambda (Faas). i understand that AWS lambda is a process running in some ec2 container( with reqd computing resources (memory & cpu)). and every time a lambda function is invoked, this process boots up (cold start) and runs the logic as given in the function and then terminates after a specific idle time.But one thing that beats me is what is the underlying code that accepts this function,is it some kind of java process which has some function that takes the lambda as the input(supplier),and pass the result back.and how does the transfer of the function to destination process takes place (http or any other protocol). I know my question is very raw,but could someone make it clear to me. Thanks

Sal
  • 167
  • 2
  • 10
  • Like this? - https://aws.amazon.com/blogs/compute/container-reuse-in-lambda/ and this? - https://medium.com/epsagon/lambda-internals-exploring-aws-lambda-462f05f74076 . – Dave S May 02 '18 at 16:07
  • hi dave,i have already gone through this article,my question is more about internals of process which is handling the user function. – Sal May 02 '18 at 16:18
  • 1
    It might help to understand more about why you want to know this. AWS doesn't, to my knowledge, share how this all works under the covers but you can probably assume a few things: custom containers running on EC2 specific to your choice of runtime environment (node, python, etc.), functions stored in and retrieved as needed from S3 (or cached in front of S3) over HTTPS/TLS, and huge orchestration around it. Suspect there's not much Java going on here (unless your chosen runtime is Java) because of JVM latency. – jarmod May 02 '18 at 16:40
  • Thanks Jarmod ,out of curiosity i wanted to know about what goes into setting up a service like lambda (faas),irrespective of the provider,the bare bones architecture and nothing more.so even when i am not using something like lambda(aws),i can still leverage the architecture. – Sal May 02 '18 at 16:54
  • OpenFaaS might provide some additional ideas: https://github.com/openfaas/faas – jarmod May 02 '18 at 18:13
  • *"so even when i am not using something like lambda (aws), I can still leverage the architecture"* This suggests that you are overlooking some significant aspects of Lambda: the "architecture" includes massive amounts of on-demand compute power. *"AWS lambda is a process running in some ec2 container"* No. Each concurrent invocation of your function runs in its own container. The service creates and destroys these with your workload, so you don't need to have this capacity on standby. A significant point of Lambda is that you don't manage this capacity or pay for it when it is idle. – Michael - sqlbot May 02 '18 at 18:47

1 Answers1

0

Based on my understanding, depending on the specific run time language selection (NodeJS, Java, Python), you get containers with different run time environments.

For example, if you are using Java, JVM should be already installed in the base container of the particular runtime.

Since the bootstrap process is more frequent, these containers should be lighter with minimal dependent libraries or frameworks readily available inside.

To get an understanding of the specifics of the Lambda Containers Install AWS SAM Local Docker Containers which will be closer to what we expect in Lambda.

Ashan
  • 18,898
  • 4
  • 47
  • 67