简体   繁体   中英

AWS Lambda Consumes time when uploading files to S3 using node.js

My program on lambda works as it starts by fetching the file from twilio with the help of url and then it stores it on my /tmp in lambda then that file is uploaded to aws S3 from lambda's /tmp . My concern is that if its a large file say 200MB then for that time lambda runs for a lot of time . Is there any way of stopping the lambda while it is uploading to s3 and then wakes when s3 upload is completed successfully. And can similar concept possible for downloading so that lambda could stop and when file is uploaded to /tmp it wakes and does the uploading of file to the AWS S3 . That can save a lot of time

The hard drive where /tmp exists and the CPU that is processing the upload/download and the memory needed for buffers used by the upload/download... are provided by the running Lambda container that is processing the transfer.

The fact that you have access to these resources is exactly because you are paying for a running Lambda container.

If it were possible to stop it from running, or pause it, you would have no access to those resources, and the upload/download would stop happening.

This isn't possble.

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