On Sat, Apr 29, 2017 at 3:09 AM, Nikos Anastopoulos <n.anas...@gmail.com> wrote:
> Τη Σάββατο, 29 Απριλίου 2017 - 7:33:00 π.μ. UTC+3, ο χρήστης Nikos
> Anastopoulos έγραψε:
>>
>> Either through the /proc/PID/tasks entries, or using
>> GODEBUG=schedtrace=1000.I get consistent results with both ways
>
>
>  With some experimentation more I did, I tend to believe this behavior has
> somehow to do with the number of CPUs of the platform; or to be more
> precise, to the number of CPUs made available to the Go app through the CPU
> affinity mask. When reducing the available CPUs from 88 to 44, 22, 11, and
> so on, the total number of threads after a 4-min run decreases as well, as
> you can see from the detailed results below (look at the "threads" field).
> So it is quite possible that if you try to reproduce the test on a low-count
> CPU environment you won't see anything weird.

All else being equal, which it never is, the number of threads used by
Go will tend to level out at about GOMAXPROCS plus a bit.  If you have
88 available CPUs, GOMAXPROCS will default to 88, and over time you
should expect to see your program using around 92 threads.

If you see the number of threads growing significantly beyond
GOMAXPROCS, without an obvious explanation like blocking C threads,
then there may be a problem.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to