question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use a pool of browsers to execute render requests

See original GitHub issue

Currently a new chrome instance is launched for every render request, which introduces latency and the possibility of running out of memory if too many requests come in at once.

Originally this requirement was because there wasn’t a way to set the timezone for a particular page in puppeteer, but that is now available: https://github.com/puppeteer/puppeteer/blob/v2.0.0/docs/api.md#pageemulatetimezonetimezoneid

I’d suggest using https://github.com/Vincit/tarn.js to manage the pool of puppeteer browser objects so that we can easily handle multiple requests by running up to pool.max chrome instances and queuing requests until an instance is available.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
DanCechcommented, Jan 13, 2020

Looks like alpine now has 79.0.3945.88-r0 in 3.11 and in edge

0reactions
DanCechcommented, Dec 11, 2019

Aha, that is a problem then, since the alpine packaged version in edge right now is 78.0.3904.108-r0 https://pkgs.alpinelinux.org/package/edge/community/x86_64/chromium which seems to be the current stable release as that’s the version in the ubuntu etc repos also.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rendering 2 billion pages with a headless browser for ...
A renderer application requests the client-side rendered version and executes ... a pool of Chromes and connecting them to execute tasks.
Read more >
Automate an isolated browser instance with just a few lines of ...
To ensure the security of your Worker, individual remote browsers are run as disposable instances – one instance per request, and never shared....
Read more >
Scraping Dynamic Websites Using Web Browsers - ScrapFly
Introduction to using web automation tools such as Puppeteer, Playwright, Selenium and ScrapFly to render dynamic websites for web scraping.
Read more >
How web browsers use Processes and Threads
How web browsers use Processes and Threads. A process can be described as an application's executing program. A thread is the one that...
Read more >
Will Running JavaScript in the Browser Block Rendering?
Chrome_ChildIOThread: Record the corresponding IO thread task record. such as networking, user input, device-related tasks, etc. Parse HTML: Convert HTML ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found