2

I am running an Ubuntu 12.04 server via a virtual machine (it is running on vmware's ESXi hypervisor) but I am not convinced it has full access to the 8 CPUs that I have assigned to it. My physical server has 2 phyiscal chips with 4 physical cores. I assigned this same configuration to my virtual server. Unfortunately I have never seen any single process get above 12.5% CPU load and I am thinking there might be an issue with my config.

TL:DR - What is the easiest way to max my CPU usage via CLI for testing purposes?

Scott
  • 123
  • 4

3 Answers3

3

Use the stress utility to generate a CPU load on your system.

Something like:

[root@xt ~]# stress --cpu 8
stress: info: [1009156] dispatching hogs: 8 cpu, 0 io, 0 vm, 0 hdd

enter image description here

What exactly are you interested in testing?

ewwhite
  • 197,159
  • 92
  • 443
  • 809
  • This is prefect. It maxed out all my CPU cores just like I wanted it to. (I wanted to confirm that the vm had access to all the cores assigned). – Scott Oct 04 '12 at 18:35
1

100% / 8 = 12.5. You're maxing out only one of your 8 possible cores. Run a multi-threaded program.

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
0

It's not possible for a single process to get above 12.5% CPU usage in a system with 8 CPUs.

More specifically, a single-threaded process cannot do more than one thing at a time. If a processes on a system with 8 processors is doing relentless back-to-back calculations on CPU 0, then it is consuming 12.5% of the available CPU resources on that system. In order to load multiple cores, you need to run multiple processes, or write a piece of software that will thread to multiple cores.

Kyle Smith
  • 9,683
  • 1
  • 31
  • 32