Reputation: 3061
I am using Task Parallel Library to process a number of complex mathematical computations. The majority of the data is loaded into memory prior to processing data. However, each calculation does query the SQL Server multiple times.
I have run the same process on 2 different computers one maxes out the CPU and the other does not.
First computer has 2 x Xeon E5-2687W processors (8 cores per processor) and 64GB 1600 MHz RAM. The Windows Machine is a Parallels 10 Virtual Machine. The second is a MacBook Pro with i7-4850HQ (8 cores) and 8GB 667 MHz RAM:
Computer 1 runs at about 25% cpu utilisation with the work being distributed across all cores.
Computer 2 runs at near 100% and finishes the work in about 2/3 of the time.
Any ideas why the Mac running a VM with 8 cores and slower RAM would be faster that machine running with 16 cores and faster Ram.
Thanks
Upvotes: 0
Views: 433
Reputation: 1
Just a guess: The first machine is not running 16 cores. It's running 8+8 cores, which is not the same, thanks to NUMA. .NET and the TPL are notoriously unaware of NUMA-effects. The task manager can show you the numa nodes.
Try using a tool like coreinfo (sysinternals) to find out which cores are on which socket, and then pin the process to these cores (SetProcessAffinityMask). If my guess is correct, you should see 50% CPU utilization (100% for the cores on said socket) and consequently the performance should double.
Upvotes: 0