简体   繁体   中英

Will 2 threads ever access my Java AWS Lambda concurrently?

Does AWS maintain a thread-pool and dispatch concurrent incoming requests to the same Lambda instance, or spin up another instance in these circumstances?

I know that at some load factor another instance will be started, but can I rely on single-threaded access within a Lambda?

A Lambda instance processes one event at the time. If more events arrive before the event is processed, a new instance is spawned. Copied from the AWS Lambda developer guide :

The first time you invoke your function, AWS Lambda creates an instance of the function and runs its handler method to process the event. When the function returns a response, it sticks around to process additional events. If you invoke the function again while the first event is being processed, Lambda creates another instance.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM