XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    CPU Usage Discrepency

    Scheduled Pinned Locked Moved Compute
    7 Posts 4 Posters 749 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T Offline
      toragmichael
      last edited by toragmichael

      Hello,

      I am troubleshooting CPU usage on a certain VM/host. This host is dedicated to one VM, and the VM has all 12 threads the physical host has. However, the graphs in XO for the host and VM do not match.

      Here's the 2 hour CPU usage on the VM:
      b54018f4-dc18-4890-a36c-a4d0ac5ab3b4-image.png

      And here's the 2 our CPU usage on the host:cb9d0eab-f40f-4ffd-99ce-28f591a6ef75-image.png

      Here is the VM CPU settings:
      c4a55891-ddee-4945-8d30-ed6142e3d6d5-image.png
      Shouldn't these graphs match given the host is running a single VM, and the VM has all 12 threads? According to the host the CPU is barely being used, while the VM has high usage on multiple cores.

      Am I losing performance at all?

      DarkbeldinD 1 Reply Last reply Reply Quote 0
      • DarkbeldinD Offline
        Darkbeldin Vates 🪐 Pro Support Team @toragmichael
        last edited by

        @toragmichael Hi,
        First you don't have only one VM on your host, you also have your dom0 that is running there.
        Second on one side you have virtual CPU attach to a VM on the other you have the physical CPU attached to the hardware so not having the sale result is quit normal.
        Still 37% usage for one VM is quit a lot, mostly I think you are using your host heavily.
        For the performance part I'm really not sure without testing it trying to push your host further could result in better or worth perf because an hypervisor is not really optimise to run only one VM but more to share the ressources between VMs.

        1 Reply Last reply Reply Quote 0
        • olivierlambertO Offline
          olivierlambert Vates 🪐 Co-Founder CEO
          last edited by

          You have to think your VM as a "process" from Xen perspective (like a program using 100% of one CPU, it might be scheduled on different cores by your operating system).

          One vCPU inside the VM can be scheduled to different physical cores (when you think it's the same vCPU, it might be various physical CPUs). That's the role of the Xen scheduler (called credit2).

          K 1 Reply Last reply Reply Quote 0
          • K Offline
            KPS Top contributor @olivierlambert
            last edited by

            That's quite interesting!

            It makes sense, that the scheduler "rotates" the load over the cores, but it wonders me, that the "single-threaded-load" of the VM is not shown on the whole system.

            Shouldn't one core be at least at 75%, if one core in the VM is at 75%?

            1 Reply Last reply Reply Quote -1
            • olivierlambertO Offline
              olivierlambert Vates 🪐 Co-Founder CEO
              last edited by

              It's because possibly your thread is spread once one a physical CPU, then on another CPU, then another, and the 75% is of one vCPU, which isn't the same physical CPU all along.

              K 1 Reply Last reply Reply Quote 0
              • K Offline
                KPS Top contributor @olivierlambert
                last edited by

                @olivierlambert
                So, 75% of one core is 75% of one core, but the time-resolution of the graph and the rotation over the physical cores makes this "hidden"?

                1 Reply Last reply Reply Quote 0
                • olivierlambertO Offline
                  olivierlambert Vates 🪐 Co-Founder CEO
                  last edited by

                  1. The graph is doing average for the last 5 seconds
                  2. You are presuming there's a perfect mapping between 1x vCPU and 1x physical CPU. Xen could schedule one vCPU into various physical CPUs. Likely, one of your vCPU load is spread on more physical CPUs.

                  Remember: for Xen, your whole VM is like a process. It will be scheduled on "real" CPUs in a way that might be not "what you see" from the guest.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post