Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> One of the things that is not immediately obvious from Lambda is that it has a local /tmp directory that you can read from and write to.

The other big thing a lot of people don't know about Python on Lambda is that your global scope is also persisted for that execution context's lifetime like /tmp is. I ran into issues at one point with Lambdas that processed a high volume of data getting intermittent errors connecting to S3. An AWS engineer told me to cache my boto3 stuff (session, client, resources, etc.) in the global namespace, and that solved the problem overnight.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: