Need help to find the better way to handle the CPU usage

sukku

Junior Member
Aug 27, 2008
3
0
0
Hello,

Previously I was using Pentium 3 machine and I will be running an application continuously for few days to do some conversion using a third party tool. The tool used to take around 8 days to complete the conversion process.

Recently I upgraded my PC and am using Intel Pentium D CPU 820 2.8 GHz with 1 GB of DDR ram. Now I am running the same application with the same set of process but this takes around 14 days to complete. After long analysis on this task I found that the CPU memory is used only 40 to 60% throughout the process.

CPU usage

Please see the attachment. The CPU usage is around 50% only. Previously on Pentium 3 machine it will be around 90 to 100%.

Is there anyway to increase the CPU usage level?

Thanks in advance.
 

JonnyBlaze

Diamond Member
May 24, 2001
3,114
1
0
the 50% means 50% of both cores. so its maxing one of your two cores.

what program are you running? there has to be a problem somewhere if its that much slower on a p4
 

sukku

Junior Member
Aug 27, 2008
3
0
0
I thought it is using only one core as it shows the usage as 50%. The application is third party application exclusively developed for us.

yes. it works great in P4. much faster than our dual core PC.

This is not PC related problem. I have tried on many machines at my work and got same result. So, it is related to CPU only.
 

JonnyBlaze

Diamond Member
May 24, 2001
3,114
1
0
the software wont use both cores unless its multithreaded. what you can do is run 2 instances of the program and both will run at full speed.
 

Idontcare

Elite Member
Oct 10, 1999
21,110
64
91
Originally posted by: sukku
I thought it is using only one core as it shows the usage as 50%. The application is third party application exclusively developed for us.

yes. it works great in P4. much faster than our dual core PC.

This is not PC related problem. I have tried on many machines at my work and got same result. So, it is related to CPU only.

Apparently you have in your hands one of those "corner cases" where cache thrashing from thread migration is actually quite detrimental.

To confirm this, and to alleviate the issue, you need to set the thread affinity for the program to just one of your cores.

One way to do this is to start your program and then open task manager. Go to the "Processes" tab and under the "Image Name" column find your application's worker thread (it should be the one which correspondingly has a 50% value under the "CPU" column).

Right click on this worker thread and you should see a pop-up, at the bottom is the option "Set Affinity...".

Clicking set affinity should pop-up "Processor Affinity". There should be a CPU0 and a CPU1 listed for you, both should have green checks in the boxes. Simply click one of the green boxes (doesn't matter which) to disable the thread from operating on that core.

The objective here is to have only one box checked with the green check, which indicates that the thread is now locked to operating just on that CPU core. Select OK.

Now you should see one CPU core running at 100% and the other at nearly 0%. Hopefully your processing time is now much faster and similar to your other P4 systems.

You have to do this (set affinity) every time you open the application. There are ways to get it to set affinity by default but the technique is complicated and not guaranteed to work (only works for some apps).