I hope to figure out a node.js system with workerpool to handle cpu intensive tasks, but there is something confused me about the cpu usage in multiple routes. A scenario is like this:
route1.js:
const workerpool = require('workerpool');
const pool = workerpool.pool(__dirname + '/job1.js');
pool.exec.......
route2.js:
const workerpool = require('workerpool');
const pool = workerpool.pool(__dirname + '/job2.js');
pool.exec.......
route3.js:
const workerpool = require('workerpool');
const pool = workerpool.pool(__dirname + '/job3.js');
pool.exec.......
When the node.js use these three files, they will create their own workerpool, and since worker_thread number and its control is via node.js internals, is this possible to create threshold problem? And how to use workerpool in a correct way, thanks a lot.