Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

159
Views
Make Puppeteer use more cores

I'm not very knowledgeable about browser core usage but I've read that it only uses one core.

If I open 4 chromium, will it use 4 cores? It tested it and it does open 4 browsers but I can't tell if they are only using one core for all the browsers or one core for each browser.

const puppeteer = require('puppeteer')

const start = async function() {
    
    async function openBrowser() {
        const browser = await puppeteer.launch({headless: false,defaultViewport: {width: 1920,height: 1080}})
        const page = await browser.newPage()

        //A browser will close after 10 seconds
        setTimeout(()=> {browser.close()}, 10000)
    }
    
    setTimeout(() => openBrowser(), 3000)//Browser will open with 3 second intervals
    setTimeout(() => openBrowser(), 6000)//Browser will open with 3 second intervals
    setTimeout(() => openBrowser(), 9000)//Browser will open with 3 second intervals
    setTimeout(() => openBrowser(), 12000)//Browser will open with 3 second intervals
}

start()

I have 20 task and I want do 4 of them simultaneously.

I want to call 4 browsers at a time and do the task rather than calling 1 browser and doing 4 async function inside that browser to do the task which in theory will only use 1 core.

My code would look like this:

const puppeteer = require('puppeteer')

const start = async function(task) {
        const browser = await puppeteer.launch({headless: false,defaultViewport: {width: 1920,height: 1080}})
        const page = await browser.newPage();

        await page.goto('myURL')
        await page.click(task)        
}

start('task1')
start('task2')
start('task3')
start('task4')

Would someone push me to the right way to go about this?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!