[erlang-questions] Strange multi-core result on windows.

Ian hobson42@REDACTED
Sun Nov 27 00:41:40 CET 2011


HI all,

I have written a program in Erlang, that has 4 async processes in 
"string of pearls" formation. The results were surprisingly quick, so I 
threw a huge input file at it to see what would happen.

Expected one process (the 2nd) to require more cpu than the others. As 
the limiting factor it would max out one core to 100%. The rest would 
be  less, constant and approx equal.  But this isn't what happened.

Three cores were loaded about 40-50%. The 4th core was left at virtually 
idle (2%).  Job ran in 25 seconds, average load about 32%.

So I moved the input and output files to a ram disk. And got much the 
same result. It ran in 22 seconds, and loaded 3 cores, one 50% and 
varying, the others 30% or so, Overall 30%.

Then I tried with +A 5 and the RAM drive. Now it loaded one core 60 to 
90%, and a a second about 40-60%. The other two cores flickered a little 
and settled back to background! Job ran in 23 seconds, average load 
about 30%.

So I guess that disk was not limiting the speed. But what was? I never 
got the load over 35%.

Can some kind person please explain the scheduling algorithm in the VM, 
and explain these results. They seem very odd to me.

Thanks

Ian











More information about the erlang-questions mailing list