Also, the cache gets invalidated after some time, and the story repeats. They are multiple layers of file system cache, but it won't help us for the first run. So the container starts fast, but if you need to access big files from your image, they will be loaded over the network, probably from ECR. AWS engineers decided to load only needed chunks of data from the image when it's needed. When Lambda launches, it doesn't load the whole docker image to the instance it's running on. The answer is hidden in the specifics of the Lambda filesystem. Second-time browser launch is so much faster! But why? We can see that the first time our function starts in a few seconds, but then it launches the browser and opens a new tab. Wow, that's unexpectedly slow! Let's trigger it one more time to check how warmed-up lambda works: Here are performance results for the first cold start run: You can find the full deploy bash script in the git repo containing all code and automation from this article.
0 Comments
Leave a Reply. |