When I am using the
zip utility in Linux to compress files, CPU utilization is going to 100%.
Can anybody help me why CPU utilization is so high?
I'm using the command:
zip file_name *.xml
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
CPU utilization is high if the task can use a lot of CPU power without being interrupted. You could say: A high CPU utilization is good because it makes increasing the speed of the computer easy...
If you would compress a file which can be compressed with minimal effort (e.g. repeat the same line of text 100000 times), do that on an extremely fast CPU and load the file from an extremely slow disk (or network storage) then the CPU utilization would decrease. But it would do so because the CPU waits for I/O all the time. If the storage is very fast and the CPU very slow then CPU utilization increases because the I/O wait time in relation to the CPU time decreases.
A CPU utilization below 100% means that your CPU has unused resources. That's usually not what you want. A process with high CPU utilization is even better for the other processes on the system because it does not impact their I/O bottleneck.
Which processes are executed more slowly when several processes are really competing for CPU time (each of them could use 100% CPU) depends on the CPU priority which can be seen with
top and set with
renice. cgroups are a mighty concept for prioritizing groups of processes.