java - How does AWS Lambda serve multiple requests? -
how aws lambda serve multiple requests? want know multi-thread kind of model here well?
if calling lambda api gateway. , there 1000 requests in 10 secs api. how many containers created , how many threads.
how aws lambda serve multiple requests?
independently.
i want know multi-thread kind of model here well?
no, not multi-threaded model in sense asking.
your code can of course written use multiple threads and/or child processes accomplish whatever purpose intended accomplish for 1 invocation, lambda doesn't send more 1 invocation @ time same container. container not used second invocation until first 1 finishes. if second request arrives while first 1 running, second 1 run in different container.
if calling lambda api gateway. , there 1000 requests in 10 secs api. how many containers created , how many threads?
as many containers created needed process each of arriving requests in own container.
the duration of each invocation largest deterninant of this.
1000 quick requests in 10 seconds equivalent 100 requests in 1 second. assuming each request finishes in less 1 second , arrival times evenly-distributed, expect fewer 100 containers created.
on other hand, if 1000 requests arrived in 10 seconds , each request took 30 seconds complete, have 1000 containers in existence during event.
after spike in traffic inflates number of containers, tend linger few minutes, ready handle additional load if arrives, , lambda start terminating them.
Comments
Post a Comment