Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Actual number of cores in a function

Hello.

I'm using a Cloud Function to prerender my web app using Puppeteer.
Since this is a time-critical task, I'd want to utilize the CPU to its full capability.
However, I must not open more than one browser tab per CPU core, since simultaneous page loads in a single core might make Puppeteer snapshot pages too soon.

Node.js's availableParallelism reports that there is only 1 core when using 1 CPU but that there are 4 cores when using 2 CPUs.

https://nodejs.org/api/os.html#osavailableparallelism

Are those numbers correct or availableParallelism somehow cannot detect the actual number of cores available?

0 0 358
0 REPLIES 0