0

Is there a way to load test CPU utilization at the kernel level?

Output for sar

09:00:01 AM     CPU      %usr     %nice      %sys   %iowait    %steal      %irq     %soft    %guest    %gnice     %idle
09:01:01 AM     all     12.61      9.28     77.46      0.00      0.00      0.00      0.65      0.00      0.00      0.00
09:02:01 AM     all     12.21      9.40     78.00      0.00      0.00      0.00      0.40      0.00      0.00      0.00
09:03:01 AM     all     12.28      8.55     78.66      0.00      0.00      0.00      0.51      0.00      0.00      0.00
09:04:01 AM     all     12.09      9.44     78.14      0.00      0.00      0.00      0.33      0.00      0.00      0.00
09:05:02 AM     all     13.58      8.67     77.32      0.00      0.00      0.00      0.43      0.00      0.00      0.00
09:06:01 AM     all     65.34      0.63     33.46      0.00      0.00      0.00      0.57      0.00      0.00      0.00
09:07:01 AM     all     30.95      6.25     62.38      0.00      0.00      0.00      0.42      0.00      0.00      0.00
09:08:01 AM     all     12.98      9.06     77.60      0.00      0.00      0.00      0.37      0.00      0.00      0.00

Load test a server so that %sys goes above 90%

taq
  • 1
  • But why? What problem are you trying to solve? – rvs Sep 06 '21 at 21:32
  • This was to recreate a bug in weave-net and potentially solve it in future – taq Sep 10 '21 at 15:41
  • I'd say in this case it may be better to focus on circumstances of when bug occurs, rather than trying to replicate one metric. Like, run a bunch of containers with some network testing, try various packet sizes, etc. – rvs Sep 11 '21 at 14:25

1 Answers1

0

The easiest way to create kernel level load is to use this command or create I/O.

fulload() { dd if=/dev/zero of=/dev/null | dd if=/dev/zero of=/dev/null | dd if=/dev/zero of=/dev/null | dd if=/dev/zero of=/dev/null & }; fulload; read; killall dd

for adding more threads, add more dd statement

dd if=/dev/zero of=/dev/null

taq
  • 1