- Newest
- Most votes
- Most comments
As described in the following document, "/tmp" may be cached and therefore may be shared if functions are executed at the same time.
As far as I know, there was no way to prevent it from being cached.
A good countermeasure would be to delete the files when the process is finished.
https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtime-environment.html
Each execution environment provides between 512 MB and 10,240 MB, in 1-MB increments, of disk space in the /tmp directory. The directory content remains when the execution environment is frozen, providing a transient cache that can be used for multiple invocations. You can add extra code to check if the cache has the data that you stored. For more information on deployment size limits, see Lambda quotas.
Lambda functions run within an execution environment. Each such execution environment runs a single request at a time. If we get multiple requests at the same time, Lambda creates new execution environments to handles those requests. If we get a request and we have an idle environment, we will let that environment handle the new request.
The /tmp folder is unique to each execution environment. This means that it is not shared between environments, but it is shared between different requests happening in the same environment (not at the same time).
Relevant content
- asked 2 years ago
- Accepted Answerasked 2 years ago
- asked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago