Show HN: Run Puppeteer on AWS Lambda

by alixaxelon 12/6/2018, 11:19 AMwith 24 comments

by sriram_iyengaron 12/6/2018, 12:50 PM

What is the advantage of running automated tests as lambda ? Typically when automation tests are run, they are long running processes and lambda execution may not be suitable. The cold start times of lambda is another challenge. What is a good practice/model for running suites ? One test per lambda or, one spec per lambda ? Still inclined to have ec2 instances created and destroyed via devops tools like terraform to run automation. Thoughts please.

by tnoleton 12/6/2018, 8:12 PM

I run a ton of Puppeteer jobs (300k in the last month), currently on EC2 and Digital Ocean VM's, mostly due to the subtle difficulties of running Puppeteer on Lambda.

Will certainly have a look at this project and contribute where possible.

My main concerns are not so much cold start time, as for my use case this is not really a huge issue, but mainly the performance of Chrome on AWS Lambda boxes. The rendering, navigation etc. needs to be snappy.

by dschepon 12/7/2018, 5:38 PM

Here's another alternative lambda layer containing headless chrome with and puppeteer example: https://github.com/RafalWilinski/serverless-puppeteer-layers

by naileron 12/6/2018, 12:28 PM

This is fantastic.

- I'm just getting started with Lambda so pardon if this is ignorant, but what's the cold start time of Chromium? Or can you warm start it somehow?

- Since scraping often depends on state, wouldn't you hit a timeout doing longer scraping joba?