News for hackers. Stuff that matters.
Re:Running Java in a Container by adrianmonk on Wednesday March 21, 2018 @03:41PM (#16641582)
I wonder if it might be a good general rule to never give just 1 CPU to any multi-threaded application (JVM or otherwise).

Often, there's a mix of threads, some of which are doing CPU-intensive stuff and some which just need to do some quick thing to unblock something else, like start some new IO when some IO completes. With 1 CPU, any time any CPU-intensive stuff is happening, these quick things have to wait their turn until the next time slice. With 2 CPUs, you have twice the work and twice the likelihood of having to deal with CPU-intensive stuff, but CPU-intensive moments don't necessarily happen at the same time, so you have better odds of having one of those CPUs immediately available to do the small, quick stuff.

There are no comments on this comment yet.