I recently made my first automated app using Node and Puppeteer. I was wondering if it was possible to run multiple instances of the app at the same time and how that would be done.
Right now, I'm simply running it one time with the Node command in the terminal. I would like to be able to run the same app multiple times to increase efficiency. How can this be done?
CodePudding user response:
For a "multi-threaded" Puppeteer app, consider using multiple BrowserContext objects, which should allow you to efficiently run Puppeteer scripts both in parallel and isolated from each others' sessions. This allows the "parent" Node and Puppeteer processes to run in one memory footprint instead of using more memory for additional Node/Puppeteer instances.
CodePudding user response:
You can use https://github.com/thomasdondorf/puppeteer-cluster for multiple browser & parallels workers.
