I need to use PuppeteerSharp in a multi threaded app. Can I use Puppeteer.LaunchAsync() as a singleton? Is browser.NewPageAsync() resource intensive? If it is, can I use resource pool pattern? What cleanup is needed before reuse?
Asked
Active
Viewed 885 times
1 Answers
3
You have to keep in mind that there is browser behind. A Page instance won't be as resource-intensive as the Chromium tab being controlled under the hood.
Being said that, you can do it. The trick is finding the perfect balance of the number of tabs and network requests one single Chromium instance can handle on the deployed machine.

hardkoded
- 18,915
- 3
- 52
- 64
-
Thanks for the guidance. Puppeteer.LaunchAsync() can still be a singleton since it launches a browser instance? – frosty Apr 29 '20 at 17:45