from Hacker News

Show HN: Run Puppeteer on AWS Lambda

by alixaxel on 12/6/18, 11:19 AM with 24 comments

  • by sriram_iyengar on 12/6/18, 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 tnolet on 12/6/18, 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 dschep on 12/7/18, 5:38 PM

    Here's another alternative lambda layer containing headless chrome with and puppeteer example: https://github.com/RafalWilinski/serverless-puppeteer-layers
  • by nailer on 12/6/18, 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?