Operating System - HP-UX
1837159 Members
2710 Online
110112 Solutions
New Discussion

nice in C Shell to reduce CPU load

 
Ho_5
Advisor

nice in C Shell to reduce CPU load

Hi,

I use C Shell to build a script.
I use gzip to compress a big tar file 140MB.
But when I execute gzip CPU use will be increase to 97.1%.
I want to decrease the CPU use when gzip is running, I know nice command can be use to reduce the CPU load
my question is:
For C Shell,
nice -19 has highest priority --> CPU load high
nice +19 has lowest priority --> CPU load low
Is that true??
I use nice +19 , but still CPU load is 97.1%.
Do you know how can I reduce the CPU load in C shell when gzip is running??

many thanks.

Regards,

John
1 REPLY 1
Laurent Menase
Honored Contributor

Re: nice in C Shell to reduce CPU load

Hi John,

Nice only change the priority of your gzip
not the CPU load.

If nothing has to run at the same time, and if you have good IO, there is no reason why gzip should not get as much as cpu as it can.

To see that in one window you run your niced gzip.
in an other window you run in ksh
while : ;do i=1 ; done
Then you'll see the CPU load used by gzip lowered.

On HPUX you need a product like PRM to limit the cpu usage of a process.

The cpu is used according to the needs.
It is used by any thread ready to run, by priority order.
Laurent