If there is a process per CPU core, and the same process always runs on the same core, the result is generally *less* context switching. But that effect is nothing compared to the reason for the 1 worker per core recommendation.
While node uses multiple threads behind the scenes, only one of those cores runs your JS. Since your request handling and any other logic you've written is generally written in JS it can easily become a bottleneck while your other cores that aren't running your JS are mostly idle. ~Ryan On Mon, 18 May 2015 at 21:04 Ω Alisson <[email protected]> wrote: > I see many articles saying to spawn workes equal to CPU cores, but what > about context switching cost? > > -- > Job board: http://jobs.nodejs.org/ > New group rules: > https://gist.github.com/othiym23/9886289#file-moderation-policy-md > Old group rules: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > --- > You received this message because you are subscribed to the Google Groups > "nodejs" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/nodejs/CACZE8Y5RbgMebOSks7VsO4GNiRjGy%3DPhj1oJh1FzfRhiHdgo%2Bg%40mail.gmail.com > <https://groups.google.com/d/msgid/nodejs/CACZE8Y5RbgMebOSks7VsO4GNiRjGy%3DPhj1oJh1FzfRhiHdgo%2Bg%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/CAGjmZGyky_aKj0umpkWxL4_%2BPb1eg2P%2BBE%2BW9TvN%3DG3kHstBPA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
