Re: anyone can help? weird Linux concurrency problem in math calculation
- From: "Nils O. Selåsdal" <noselasd@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: 20 Jan 2006 21:32:53 +0100
wsTechie wrote:
Hi,
I ran into a really weird concurrency problem in Linux box. In a nutshell, I have a standalone console program that does intensive math calculation. The program has just one thread. I run one instance of the program, it takes 19.5 seconds to finish. I run two concurrent instances on a two-cpu Linux server, I'd expect that they'd take about the same time, but to my surprise, they took 31 seconds to finish. So running two concurrent instances slows down each one even two cpu's are fully loaded.
More information is listed in the following after a lot of investigations.
1. top confirms that two cpu's are all busy when two concurrent processes. cpu usage is about 99%-100% 2. other existing jobs take negligible cpu times, below 2% 3. no shortage of memory, so no memory swaping 4. top confirms that there is little system or io activities during the time of program. 5. the same program has no such concurrency problem on NT, nor on Solaris
Has anyone seen this before? Is there something I can investigate further?
Well firstly make sure it IS 2 cpus, and not hyperthreading :-)
Anyways, There's alot of bus sharing on SMP systems, so if you're heavily accessing memory (and not just within the caches) there might actually be contention. It also depends quite a bit on what kernel version you run, some older kernels juggled the processes back and forth between the CPUs, which means one might not benefit from the caches as much as one could.
.
- References:
- Prev by Date: anyone can help? weird Linux concurrency problem in math calculation
- Next by Date: Re: working with files the linux way...
- Previous by thread: anyone can help? weird Linux concurrency problem in math calculation
- Index(es):
Relevant Pages
|