Ivan Youroff Ivan Youroff - 24 days ago 11
HTTP Question

Will multiple AWS Lambdas making request to some HTTP(s) resource be detected as throttling?

Suppose I have multiple AWS Lambdas making a request to some HTTP API, is there any documentation how these requests will be seen on the API side in terms of throttling. Will they be treated as requests coming from different hosts or sometimes (or always) the same one?

Answer Source

You should assume no 2 runs of the same Lambda function will even run on the same machine. AWS might reuse the same instance to run your function, but that's to save the time spent downloading the code on every function call.

You can here from the AWS Lambda FAQ page found here, the following:

Q: Will AWS Lambda reuse function instances?

To improve performance, AWS Lambda may choose to retain an instance of your function and reuse it to serve a subsequent request, rather than creating a new copy. To learn more about how Lambda reuses function instances, visit our documentation. Your code should not assume that this will always happen.

Q: Why must AWS Lambda functions be stateless?

Keeping functions stateless enables AWS Lambda to rapidly launch as many copies of the function as needed to scale to the rate of incoming events. While AWS Lambda’s programming model is stateless, your code can access stateful data by calling other web services, such as Amazon S3 or Amazon DynamoDB.

Also, to understand more take a look at this interesting blog post (back from 2014)