Configure simultaneous multi-threading (SMT) Stay organized with collections Save and categorize content based on your preferences.
This page shows you how to configuresimultaneous multi-threading in yourGoogle Kubernetes Engine (GKE) clusters.
Overview
GKEnodesare Compute Engine virtual machine (VM) instances that GKEcreates on your behalf. On these VMs, it's common to havesimultaneous multi-threading (SMT) enabled by default. SMT is the ability to execute multipleindependent threads on a single physical CPU core. With SMTenabled, a single physical core can run two virtual CPUs (vCPUs) as independent,separate threads. For example, ann2-standard-32 GKE node is,in fact, running 32 vCPUs on 16 physical CPU cores.
With the introduction of SMT configurability onGKE nodes, you can now configure SMT so that thenumber of effective vCPUs is equal to the number of physical cores, which meansthat your GKE nodes can use the full physical core per vCPU.
Benefits
Configuring SMT on GKE provides the followingbenefits.
Improved performance
Some High Performance Computing (HPC) workloads might see a performanceimprovement by disabling SMT. Typically, for many generalcomputing tasks or tasks that require lots of I/O, SMT canincrease application throughput significantly. In contrast, for compute-boundjobs in which both virtual cores are compute bound, SMT canhinder overall application performance and add nondeterministic variance tojobs. Therefore, with SMT disabled, some HPC applications mightget better and more predictable performance.
Note: To definitively understand any performance benefits, we recommend that yourun a direct comparison of your workload performance between GKEnodes that have SMT enabled and nodes with SMTdisabled.Reduced licensing costs
Some software licensing agreements have billing models that are tied to thenumber of vCPUs that are consumed. Disabling SMT reduces thenumber of vCPUs for each core by half, which might reduce your licensingcosts. For more information, consult your licensing agreement.
See thepricing section to understand how Google Cloud bills whenSMT is configured.
Limitations
- Machine types: SMT is not configurable onmachine types that have fewer than 2 vCPUs(for example
n1-standard-1) or with theN4A machineseries(Preview) orTauT2D machine series. - Node auto-provisioning: SMT configurability is notsupported for clusters that havenode auto-provisioningenabled.
- Cluster autoscaler: Scaling from zero nodes with SMTconfigurability is only supported on thecluster autoscalerfor clusters running GKE version 1.21 or later.
- GKE Sandbox: You can configure SMT settings in GKE Sandboxnodes in GKE Standard clusters running version1.24.2-gke.300 and later using the
--threads-per-coreflag, and in priorversions using a standalone DaemonSet. For instructions, refer toGKE Sandbox.Since multithreading is disabled by default in GKE Sandbox beforeversion 1.24.2-gke.300, configuring SMT usingthreads-per-coreis not supported. If you use GKE Sandbox and wouldlike to enable SMT, seeSMT may be disabled. - Cluster mode: SMT configurability is not supported onGKEAutopilotclusters.
Pricing
SMT for GKE is billed based on the underlyingCompute Engine pricing for SMT.You are billed for the number of vCPUs defined by a VM'smachine type, not the number of threads that runon each core. Even if you configure SMT, you will continue to bebilled for the default number of vCPUs defined by the VM machine type. For moreinformation about how you are billed for VMs, seeVM instance pricing.
For example, a GKE node created using then2-standard-8 machinetype runs with SMT enabled by default, and can run up to 8 vCPUs,which is 2 vCPUs for each of the four physical CPU cores. If you configureSMT to use only one thread per core (effectively 4 vCPUs), youare still billed for 8 vCPUs.
Configure SMT
You can configure SMT on new clusters or node pools by specifyingthe number of threads per core.
Note: You cannot update the number of threads per core on existing node pools.The following table shows the possible values for threads per core and thecorresponding SMT behavior for the node:
| Threads per core | SMT behavior |
|---|---|
null (not specified) | Compute Engine VM default |
0 | Invalid |
1 | SMT off |
2 | SMT on |
> 2 | Invalid |
Configure SMT on a new cluster
You can configure SMT on new clusters using the gcloud CLIor the Google Cloud console.
gcloud
To configure SMT, run the following command:
gcloudcontainerclusterscreateCLUSTER_NAME\--machine-type=MACHINE_TYPE\--threads-per-core=THREADS_PER_COREReplace the following:
CLUSTER_NAME: the name for the new cluster.MACHINE_TYPE: themachine typeto use for your GKE nodes. This must be a machine type with 2or more vCPUs.THREADS_PER_CORE: the number of threads per physicalcore. The previous table shows the values you can specify.
For a full list of options, refer to thegcloud container clusters createdocumentation.
Console
In the Google Cloud console, go to theCreate a Kubernetes cluster page.
In the navigation menu, in theNode pools section, click the name of anode pool, and then clickNodes.
In theMachine Configuration section, select a supportedMachine type,such ase2-standard-2.
ClickCPU Platform and GPU.
From thevCPUs to core ratio drop-down menu, select one of the following:
- 1 vCPU per core: turn SMT off.
- 2 vCPUs per core: keep SMT on.
Configure the cluster and node pools as required, and then clickCreate.
Configure SMT on a new node pool
You can configure SMT on new node pools using the gcloud CLIor the Google Cloud console.
gcloud
To configure SMT, run the following command:
gcloudcontainernode-poolscreatePOOL_NAME\--cluster=CLUSTER_NAME\--machine-type=MACHINE_TYPE\--threads-per-core=THREADS_PER_COREReplace the following:
POOL_NAME: the name for the new node pool.CLUSTER_NAME: the name of the existing cluster.MACHINE_TYPE: themachine typeto use for your GKE nodes. This must be a machine type with 2or more vCPUs.THREADS_PER_CORE: the number of threads per physicalcore. The previous table shows the values you can specify.
For a full list of options, refer to thegcloud container clusters createdocumentation.
Console
Go to theGoogle Kubernetes Engine page in the Google Cloud console.
Click the name of the cluster that you want to modify.
ClickAdd node pool.
In the navigation menu, clickNodes.
In theMachine Configuration section, select aMachine family andaMachine type that support SMT, such asn2-standard-2.
ClickCPU Platform and GPU.
From thevCPUs to core ratio drop-down menu, select one of the following options:
- 1 vCPU per core: turn SMT off.
- 2 vCPUs per core: keep SMT on.
Configure the node pool as needed, and then clickCreate.
Verify the SMT configuration
Linux
To verify the SMT configuration on Linux nodes, perform thefollowing steps:
SSH into the node:
gcloudcomputesshNODE_NAMEReplace
NODE_NAMEwith the name of your node.Check the number of vCPUs:
cat/proc/cpuinfo|grepprocessor|wc-lThe output is similar to the following:
16If you set the number of threads per core to
1, the output should showhalf the Compute Engine VM default number of vCPUs. For example, theoutput for then2-standard-32with SMT off should be16instead of the default value of32.
Windows
To verify the SMT configuration on Windows nodes, perform thefollowing steps:
Set a username and password to RDP to the node:
gcloudcomputereset-windows-passwordNODE_NAMEReplace
NODE_NAMEwith the name of your node.Establish a connection to the
EXTERNAL_IP:3389forthe VM.Run the following powershell command:
Get-WmiObject-ClassWin32_Processor-ComputerName.|Select-Object-Property[a-z]*|SelectNumberOfCores,NumberOfLogicalProcessorsIf you set the number of threads per core to
1, theNumberOfCoresvalueshould be equal to theNumberOfLogicalProcessorsvalue, such as in thefollowing example output:Output (example n1-standard-2 with SMT off)NumberOfCores NumberOfLogicalProcessors------------- ------------------------- 1 1
What's next
- Learn about the available machine types.
- Learn how to specify a minimum CPU platform for your GKE nodes.
- Learn about using Compute Engine sole-tenant nodes in GKE.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-11-06 UTC.