1

what would be the best approach to compare usage of the processor (in %) for two identical processes with different scheduling policy in for example one-minute time frame. I'm pretty new to the linux and I'm testing some things... but it's pretty hard for me so I will be glad for any answer.

1

Some extra details could have been useful to give you a better answer.

To monitor the CPU activity, you can use the sar command like this :

sar [interval] [count]

So you'll get a short report of CPU usage every interval seconds, up to count reports.

For example :

$ sar 1 3
Linux 4.19.0-0.bpo.4-amd64 (caramba)    05/14/2019      _x86_64_        (2 CPU)

05:18:33 PM     CPU     %user     %nice   %system   %iowait    %steal     %idle
05:18:34 PM     all      3.06      0.00      2.55      0.51      0.00     93.88
05:18:35 PM     all      2.07      0.00      2.59      0.00      0.00     95.34
05:18:36 PM     all      1.03      0.00      1.54      0.00      0.00     97.44
Average:        all      2.05      0.00      2.23      0.17      0.00     95.55

The manual page (as well as online docs - there are plenty) may put you on track.

0

You can use pidstat [interval][count] -p processID to monitor specific process. sysstat pack provides this and some other tools for monitoring.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.