1829690 Members
9355 Online
109992 Solutions
New Discussion

Run process

 
SOLVED
Go to solution
peterchu
Super Advisor

Run process

I run the database re-index job in the system , it require lots of memory and CPU to process it , but I found that this job only use about 40% CPU ,and the other 60% is nearly free , how can I make the job can use the max. of CPU and memory (eg . 95% ) ? thx.
3 REPLIES 3
Simon Hargrave
Honored Contributor
Solution

Re: Run process

you'll probably find that your process is limited by disk I/O, and that the reason it's not using more CPU is because it's waiting for disk read/writes.

sar -d should show how busy your disks are, and if they are maxing out.
peterchu
Super Advisor

Re: Run process

thx reply , what is mean waiting I/O ? is it using the max. of system resource ? it not , can I make use this idle resource ? thx.
Simon Hargrave
Honored Contributor

Re: Run process

imagine in the simplest case, a server running one process, which does the following: -

does a quick calculation
writes a lot of data to the disk
does another calculatation
writes a lot of data to the disk
...

As the program is running sequentially, it cannot get to the next "does another calculation" until it has finished "writing a lot of data to the disk".

So as you can see, when it's waiting for the OS to write to disk, it simply cannot do the calculations, and therefore use the CPU.

As this is a database re-index, the majority of work will be disk activity, and therefore it is that which is limiting the CPU usage.

The process cannot actually do anything with the spare CPU.

If you're worried about not using all your CPU, write a separate program that calculates prime numbers or something ;)