Score:0

How to display percentage of CPU load info set by stress-ng utility at specific interval into terminal?

in flag

I need to write stress testing utility to set all CPU to specific load value and need to display CPU load to terminal window at every 1 sec(which depends on user pass argument) so user can verified CPU load

I am setting CPU load to 80% (based on user input)and running stress-ng utility for specific time(120 sec) into background

stress-ng -c 8 -l 80 --timeout 120s &

Now How can I display all CPU load(here I am doing stress testing for 8 core) info into terminal every 1 second so user can verified that whatever load value he set using utility all CPU currently running at the same load

Score:1
gn flag

Depending on your processor make and model, you might be able to use turbostat (linux-tools-common package) to get what you want. It works with most recent Intel processors and, if your version of turbostat is new enough, many AMD processors.

Example, where I have a 12 instances of a program running at 80% utilization at a work/sleep frequency of 273 hertz on a 6 core 12 CPU Intel 10600K processor, and I am sampling at 6 seconds per sample:

$ sudo turbostat --quiet --show Core,CPU,Busy%,Bzy_MHz,IRQ,PkgWatt,PkgTmp --interval 6
Core    CPU     Busy%   Bzy_MHz IRQ     PkgTmp  PkgWatt
-       -       78.55   4800    90958   67      85.25
0       0       78.53   4800    7598    67      85.25
0       6       78.55   4800    7579
1       1       78.55   4800    7570
1       7       78.56   4800    7568
2       2       78.55   4800    7594
2       8       78.56   4800    7575
3       3       78.54   4800    7570
3       9       78.56   4800    7574
4       4       78.55   4800    7569
4       10      78.57   4800    7564
5       5       78.54   4800    7563
5       11      78.55   4800    7634
Core    CPU     Busy%   Bzy_MHz IRQ     PkgTmp  PkgWatt
-       -       78.54   4800    90801   67      85.27
0       0       78.55   4800    7567    67      85.27
0       6       78.54   4800    7575
1       1       78.55   4800    7562
1       7       78.55   4800    7576
2       2       78.54   4800    7563
2       8       78.54   4800    7569
3       3       78.54   4800    7563
3       9       78.54   4800    7563
4       4       78.54   4800    7564
4       10      78.55   4800    7571
5       5       78.55   4800    7562
5       11      78.54   4800    7566
Core    CPU     Busy%   Bzy_MHz IRQ     PkgTmp  PkgWatt
-       -       78.53   4800    90805   68      85.00
0       0       78.51   4800    7567    68      85.00
0       6       78.56   4800    7574
1       1       78.57   4800    7565
1       7       78.43   4800    7571
2       2       78.45   4800    7565
2       8       78.58   4800    7570
3       3       78.55   4800    7564
3       9       78.53   4800    7566
4       4       78.54   4800    7564
4       10      78.54   4800    7570
5       5       78.54   4800    7561
5       11      78.55   4800    7568
Core    CPU     Busy%   Bzy_MHz IRQ     PkgTmp  PkgWatt
-       -       78.50   4800    90765   68      84.39
0       0       78.34   4800    7569    68      84.39
0       6       78.58   4800    7573
1       1       78.59   4800    7560
1       7       78.36   4800    7570
2       2       78.52   4800    7563
2       8       78.55   4800    7567
3       3       78.30   4800    7535
3       9       78.58   4800    7566
4       4       78.54   4800    7561
4       10      78.55   4800    7569
5       5       78.55   4800    7564
5       11      78.54   4800    7568
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.