This page shows you how to analyze the CPU performance of your
Google Kubernetes Engine (GKE) cluster nodes using
Performance Monitoring Unit (PMU) events.
This page is intended for cluster admins who have performance-sensitive
workloads and want to examine the CPU execution of their workloads on their
GKE nodes during development, debugging, benchmarking, and
continuous monitoring.
Before you begin
Before you start, make sure that you have performed the following tasks:
If you want to use the Google Cloud CLI for this task,
install and then
initialize the
gcloud CLI. If you previously installed the gcloud CLI, get the latest
version by running gcloud components update.
Requirements and limitations
When enabling PMU events, be aware of the following requirements and limitations:
Your cluster must be Standard mode.
If your cluster has node auto-provisioning enabled, any node pools created
through auto-provisioning cannot enable PMU events. If you enable node auto
provisioning after enabling PMU events, existing node pools are not impacted.
Cluster node pools must run a machine series that supports PMU. For more
information about the supported machine types, see the
PMU limitations table.
Create a GKE cluster
Create a cluster with PMU events enabled for the default node pool:
PMU_LEVEL: the type of PMU events to collect. For more
information, see How the PMU works
in the Compute Engine documentation. Supported values are as
follows:
architectural: enables architectural PMU events related to non-last-level
cache (LLC) events.
standard: includes architectural events and enables core PMU events,
including L2 cache events.
enhanced: includes standard events and enables any local events outside
the CPU core and LLC PMU events. This option is only available with VMs that
have a specific number of vCPUs. For more information, see
Limitations in the
Compute Engine documentation.
MACHINE_TYPE: the Compute Engine machine type
for your nodes. For a list of supported machine types, see
limitations in the
Compute Engine documentation.
Verify your cluster nodes have PMU enabled by examining the kernel messages.
Get a list of nodes in the cluster:
kubectlgetnodes
The output is similar to the following:
NAME STATUS ROLES AGE VERSION
gke-c1-default-pool-44be3e13-prr1 Ready <none> 5d23h v1.27.13-gke.1070000
gke-c1-default-pool-7abc4a17-9dlg Ready <none> 2d21h v1.27.13-gke.1070000
gke-c1-default-pool-ed969ef6-4gzp Ready <none> 5d v1.27.13-gke.1070000
Record the name of one of the nodes.
Get the Compute Engine location of the node:
gcloudcomputeinstanceslist--filter=NODE_NAME
Replace NODE_NAME with the name of a node from
the previous step.
The output is similar to the following:
NAME ZONE MACHINE_TYPE PREEMPTIBLE INTERNAL_IP EXTERNAL_IP STATUS
gke-c1-default-pool-44be3e13-prr1 us-central1-c c4-standard-4 true 10.128.0.67 34.170.44.164 RUNNING
Record the name of the Compute Engine ZONE. In this example, it's
us-central1-c.
Use SSH to connect to the cluster node:
gcloudcomputesshNODE_NAME\--zone=COMPUTE_ZONE
Replace COMPUTE_ZONE with the name of the
Compute Engine zone from the previous step.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-29 UTC."],[],[],null,["# Analyze CPU performance using the PMU\n\n[Standard](/kubernetes-engine/docs/concepts/choose-cluster-mode)\n\n*** ** * ** ***\n\nThis page shows you how to analyze the CPU performance of your\nGoogle Kubernetes Engine (GKE) cluster nodes using\n[Performance Monitoring Unit (PMU)](/compute/docs/pmu-overview) events.\n\nThis page is intended for cluster admins who have performance-sensitive\nworkloads and want to examine the CPU execution of their workloads on their\nGKE nodes during development, debugging, benchmarking, and\ncontinuous monitoring.\n\nBefore you begin\n----------------\n\nBefore you start, make sure that you have performed the following tasks:\n\n- Enable the Google Kubernetes Engine API.\n[Enable Google Kubernetes Engine API](https://console.cloud.google.com/flows/enableapi?apiid=container.googleapis.com)\n- If you want to use the Google Cloud CLI for this task, [install](/sdk/docs/install) and then [initialize](/sdk/docs/initializing) the gcloud CLI. If you previously installed the gcloud CLI, get the latest version by running `gcloud components update`. **Note:** For existing gcloud CLI installations, make sure to set the `compute/region` [property](/sdk/docs/properties#setting_properties). If you use primarily zonal clusters, set the `compute/zone` instead. By setting a default location, you can avoid errors in the gcloud CLI like the following: `One of [--zone, --region] must be supplied: Please specify location`. You might need to specify the location in certain commands if the location of your cluster differs from the default that you set.\n\n### Requirements and limitations\n\nWhen enabling PMU events, be aware of the following requirements and limitations:\n\n- Your cluster must be Standard mode.\n- If your cluster has node auto-provisioning enabled, any node pools created through auto-provisioning cannot enable PMU events. If you enable node auto provisioning after enabling PMU events, existing node pools are not impacted.\n- Cluster node pools must run a machine series that supports PMU. For more information about the supported machine types, see the [PMU limitations table](/compute/docs/pmu-overview#limitations).\n\nCreate a GKE cluster\n--------------------\n\nCreate a cluster with PMU events enabled for the default node pool: \n\n gcloud container clusters create \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e \\\n --location=\u003cvar translate=\"no\"\u003eCOMPUTE_LOCATION\u003c/var\u003e \\\n --performance-monitoring-unit=\u003cvar translate=\"no\"\u003ePMU_LEVEL\u003c/var\u003e \\\n --machine-type=\u003cvar translate=\"no\"\u003eMACHINE_TYPE\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e: the name of the new cluster.\n- \u003cvar translate=\"no\"\u003eCOMPUTE_LOCATION\u003c/var\u003e: the [Compute Engine location](/compute/docs/regions-zones#available) for the new cluster.\n- \u003cvar translate=\"no\"\u003ePMU_LEVEL\u003c/var\u003e: the type of PMU events to collect. For more information, see [How the PMU works](/compute/docs/pmu-overview#how-pmu-works) in the Compute Engine documentation. Supported values are as follows:\n - `architectural`: enables architectural PMU events related to non-last-level cache (LLC) events.\n - `standard`: includes architectural events and enables core PMU events, including L2 cache events.\n - `enhanced`: includes standard events and enables any local events outside the CPU core and LLC PMU events. This option is only available with VMs that have a specific number of vCPUs. For more information, see [Limitations](/compute/docs/pmu-overview#limitations) in the Compute Engine documentation.\n- \u003cvar translate=\"no\"\u003eMACHINE_TYPE\u003c/var\u003e: the Compute Engine machine type for your nodes. For a list of supported machine types, see [limitations](/compute/docs/pmu-overview#limitations) in the Compute Engine documentation.\n\nYou can also create a new node pool for an existing cluster using the\n[`gcloud container node-pools create`](/sdk/gcloud/reference/container/node-pools/create)\ncommand.\n\nConnect to the cluster\n----------------------\n\nConfigure `kubectl` to communicate with the cluster: \n\n gcloud container clusters get-credentials \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e \\\n --location=\u003cvar translate=\"no\"\u003eCOMPUTE_LOCATION\u003c/var\u003e\n\nVerify the PMU is enabled\n-------------------------\n\nVerify your cluster nodes have PMU enabled by examining the kernel messages.\n\n1. Get a list of nodes in the cluster:\n\n kubectl get nodes\n\n The output is similar to the following: \n\n NAME STATUS ROLES AGE VERSION\n gke-c1-default-pool-44be3e13-prr1 Ready \u003cnone\u003e 5d23h v1.27.13-gke.1070000\n gke-c1-default-pool-7abc4a17-9dlg Ready \u003cnone\u003e 2d21h v1.27.13-gke.1070000\n gke-c1-default-pool-ed969ef6-4gzp Ready \u003cnone\u003e 5d v1.27.13-gke.1070000\n\n Record the name of one of the nodes.\n2. Get the Compute Engine location of the node:\n\n gcloud compute instances list --filter=\u003cvar translate=\"no\"\u003eNODE_NAME\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003eNODE_NAME\u003c/var\u003e with the name of a node from\n the previous step.\n\n The output is similar to the following: \n\n NAME ZONE MACHINE_TYPE PREEMPTIBLE INTERNAL_IP EXTERNAL_IP STATUS\n gke-c1-default-pool-44be3e13-prr1 us-central1-c c4-standard-4 true 10.128.0.67 34.170.44.164 RUNNING\n\n Record the name of the Compute Engine `ZONE`. In this example, it's\n `us-central1-c`.\n3. Use SSH to connect to the cluster node:\n\n gcloud compute ssh \u003cvar translate=\"no\"\u003eNODE_NAME\u003c/var\u003e \\\n --zone=\u003cvar translate=\"no\"\u003eCOMPUTE_ZONE\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003eCOMPUTE_ZONE\u003c/var\u003e with the name of the\n Compute Engine zone from the previous step.\n4. Examine the kernel messages:\n\n sudo dmesg |grep -A10 -i \"Performance\"\n\n The output is similar to the following: \n\n [ 0.307634] Performance Events: generic architected perfmon, full-\n width counters, Intel PMU driver.\n # Several lines omitted\n\n This output indicates the PMU driver is initialized.\n\nWhat's next\n-----------\n\n- Learn how to [Choose a minimum CPU platform](/kubernetes-engine/docs/how-to/min-cpu-platform)"]]