I have a Node app deployed on AWS Fargate on the 1 vCPU/2GB memory task config. I have been wondering about the behavior that Node.js has when running on this setup in relationship to the vCPUs that are available.
According to AWS docs, the vCPU is just a hyperthread on an intel Xeon CPU core: What vCPUs in Fargate really mean?. So, how does libuv run the threadpool (which by default runs 4 threads) if the whole program is just running on one vCPU which is already itself a hyperthread? Also, how does the Node program behave on a config running on a lower configuration with a 0.256 vCPU?
Furthermore, Fargate automatically handles scaling by running the number of tasks specified in the configuration; but, what would happen if I decided to use something like PM2 to run multiple Node processes inside each task? Would this not really work since I'm running on 1 vCPU?