Questa pagina mostra come visualizzare le metriche di utilizzo correlate ai costi per i cluster Google Kubernetes Engine (GKE). Queste metriche descrivono l'efficacia con cui i tuoi cluster e workload GKE utilizzano le risorse di Compute Engine che paghi.
Puoi utilizzare queste informazioni per ottimizzare il rapporto costo/rendimento dei tuoi
cluster e carichi di lavoro.
Metriche di ottimizzazione dei costi
Nella scheda Ottimizzazione dei costi della console Google Cloud , puoi visualizzare le seguenti metriche per i cluster e i workload:
Utilizzo CPU:mostra un grafico a barre che illustra la relazione
tra le seguenti metriche della CPU:
Utilizzato: la quantità di CPU utilizzata da tutti i container nel cluster o nel workload. Calcolato dalla metrica container/cpu/core_usage_time.
Richiesta: la quantità di CPU richiesta da tutti i container nel
cluster o nel workload. Calcolato dalla metrica container/cpu/request_cores.
Allocabile: la quantità di CPU allocata a tutti i nodi del cluster.
Questa metrica viene mostrata nella pagina Cluster. Calcolato dalla metrica node/cpu/allocatable_cores. Per i cluster Autopilot, non esiste un valore allocabile
perché Google regola automaticamente le allocazioni di CPU.
Limite: il limite di CPU per tutti i container di un workload. Questa metrica
viene mostrata nella pagina Carichi di lavoro. Calcolato dalla metrica
container/cpu/limit_cores.
Ore CPU: il numero totale di ore core su tutti i nodi di un workload o
cluster entro il periodo di tempo selezionato. Calcolato dalla metrica
node/cpu/total_cores (per i cluster standard) e dalla metrica
container/cpu/request_cores (per i cluster e i carichi di lavoro Autopilot).
Utilizzo della memoria: mostra un grafico a barre che illustra la relazione
tra le seguenti metriche di memoria:
Utilizzata: la quantità di memoria utilizzata da tutti i container in un cluster o in un workload. Calcolato dalla metrica container/memory/used_bytes.
Richiesta: la quantità di memoria richiesta per tutti i container in un cluster o un workload. Calcolato dalla metrica container/memory/request_bytes.
Allocabile: la quantità di memoria allocata a tutti i nodi del cluster. Questa metrica viene mostrata nella pagina Cluster. Calcolato dalla metrica
node/memory/allocatable_bytes. Per i cluster Autopilot, non esiste un valore allocabile
perché Google regola automaticamente le allocazioni di memoria.
Limite: il limite di memoria per tutti i container in un workload. Questa metrica viene visualizzata nella pagina Carichi di lavoro. Calcolato dalla metrica
container/memory/limit_bytes.
Ore memoria: la quantità totale di memoria su tutti i nodi di un workload o
cluster nel periodo di tempo selezionato. Calcolato in base alla metrica
node/memory/total_bytes (per i cluster) e alla metrica container/memory/requested_bytes (per i cluster e i workload Autopilot).
Visualizza le metriche
Per visualizzare le metriche di utilizzo relative ai costi, segui questi passaggi nella console
Google Cloud :
Per visualizzare le metriche a livello di cluster, vai alla pagina Cluster Kubernetes.
Scegli il periodo di tempo in base al quale calcolare la media (utilizzo) o
l'accumulo (ore totali) delle metriche. Ad esempio, 1 giorno, 1 mese e così via. Se la
durata del cluster o del workload è inferiore al periodo di tempo selezionato,
vengono visualizzate le metriche accumulate per la durata del cluster o del workload. Ad esempio, scegli un periodo di tempo di 1 giorno, ma il carico di lavoro è stato creato solo 4 ore fa, quindi vengono visualizzate solo 4 ore di metriche.
Tieni il puntatore sopra la metrica di utilizzo per visualizzare ulteriori dettagli.
Le metriche di ottimizzazione dei costi vengono visualizzate per le modalità cluster nel seguente modo:
I cluster standard avranno sempre metriche utilizzate, richieste e allocabili
visibili al momento della creazione grazie all'inclusione dei componenti GKE gestiti
nel calcolo complessivo (spazio dei nomi kube-system).
I cluster Autopilot mostrano le metriche solo quando esegui il deployment di carichi di lavoro
con richieste specificate nel cluster. Ciò è dovuto al modello di
prezzi di Autopilot. I cluster Autopilot non mostrano metriche allocabili perché
paghi solo le risorse richieste dai tuoi workload in esecuzione.
I carichi di lavoro di cui è stato eseguito il deployment nei cluster Standard che non hanno richieste o limiti specificati non mostreranno un rapporto nel grafico. Il grafico a barre
rappresenterà solo la metrica di utilizzo del carico di lavoro.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-01 UTC."],[],[],null,["# View cost-related optimization metrics\n\n[Autopilot](/kubernetes-engine/docs/concepts/autopilot-overview) [Standard](/kubernetes-engine/docs/concepts/choose-cluster-mode)\n\n*** ** * ** ***\n\nThis page shows you how to view cost-related utilization metrics for your\nGoogle Kubernetes Engine (GKE) clusters. These metrics describe how effectively your\nGKE clusters and workloads are utilizing the Compute Engine\nresources you pay for.\n\nYou can use this information to optimize the cost-to-performance ratio of your\nclusters and workloads.\n\nCost optimization metrics\n-------------------------\n\nIn the **Cost Optimization** tab in the Google Cloud console, you can view the following\nmetrics for your clusters and workloads:\n\n- **CPU utilization:** Displays a bar chart that shows the relationship between the following CPU metrics:\n - **Used** : The amount of CPU used by all containers in the cluster or workload. Calculated from the [`container/cpu/core_usage_time`](/monitoring/api/metrics_kubernetes#kubernetes/container/cpu/core_usage_time) metric.\n - **Requested** : The amount of CPU requested by all containers in the cluster or workload. Calculated from the [`container/cpu/request_cores`](/monitoring/api/metrics_kubernetes#kubernetes/container/cpu/request_cores) metric.\n - **Allocatable** : The amount of CPU allocated to all nodes in the cluster. This metric is shown on the Clusters page. Calculated from the [`node/cpu/allocatable_cores`](/monitoring/api/metrics_kubernetes#kubernetes/node/cpu/allocatable_cores) metric. For Autopilot clusters, there is no allocatable value because Google automatically adjusts CPU allocations.\n - **Limit** : The CPU limit for all containers in a workload. This metric is shown on the Workloads page. Calculated from the [`container/cpu/limit_cores`](/monitoring/api/metrics_kubernetes#kubernetes/container/cpu/limit_cores) metric.\n- **CPU hours** : The total number of core hours on all nodes in a workload or cluster within the selected timeframe. Calculated from the [`node/cpu/total_cores`](/monitoring/api/metrics_kubernetes#kubernetes/node/cpu/total_cores) metric (for Standard clusters) and the [`container/cpu/request_cores`](/monitoring/api/metrics_kubernetes#kubernetes/container/cpu/request_cores) metric (for Autopilot clusters and workloads).\n- **Memory utilization** : Displays a bar chart that shows the relationship between the following memory metrics:\n - **Used** : The amount of memory used by all containers in a cluster or workload. Calculated from the [`container/memory/used_bytes`](/monitoring/api/metrics_kubernetes#kubernetes/container/memory/used_bytes) metric.\n - **Requested** : The amount of memory requested for all containers in a cluster or workload. Calculated from the [`container/memory/request_bytes`](/monitoring/api/metrics_kubernetes#kubernetes/container/memory/request_bytes) metric.\n - **Allocatable** : The amount of memory allocated to all nodes in the cluster. This metric is shown on the Clusters page. Calculated from the [`node/memory/allocatable_bytes`](/monitoring/api/metrics_kubernetes#kubernetes/node/memory/allocatable_bytes) metric. For Autopilot clusters, there is no allocatable value because Google automatically adjusts memory allocations.\n - **Limit** : The memory limit for all containers in a workload. This metric is shown on the Workloads page. Calculated from the [`container/memory/limit_bytes`](/monitoring/api/metrics_kubernetes#kubernetes/container/memory/limit_bytes) metric.\n- **Memory hours** : The total amount of memory on all nodes in a workload or cluster within the selected timeframe. Calculated from the [`node/memory/total_bytes`](/monitoring/api/metrics_kubernetes#kubernetes/node/memory/total_bytes) metric (for clusters) and the [`container/memory/requested_bytes`](/monitoring/api/metrics_kubernetes#kubernetes/container/memory/requested_bytes) metric (for Autopilot clusters and workloads).\n\nView the metrics\n----------------\n\nTo view cost-related utilization metrics, perform the following steps in the\nGoogle Cloud console :\n\n1. To see cluster-level metrics, go to the **Kubernetes Clusters** page.\n\n [Go to Kubernetes Clusters](https://console.cloud.google.com/kubernetes/list)\n\n To see workload-level metrics, go to the **Workloads** page.\n\n [Go to Workloads](https://console.cloud.google.com/kubernetes/workload)\n2. Select the **Cost Optimization** tab.\n\n3. Choose the timeframe over which the metrics are averaged (utilization) or\n accumulated (total hours). For example, 1 day, 1 month, and more. If the\n lifetime of the cluster or workload is less than the selected timeframe,\n metrics accumulated for the lifetime of cluster or workload displays. For\n example, you choose a timeframe of 1 day but the workload was created only\n 4 hours ago, so only 4 hours of metrics are displayed.\n\n4. Hold the pointer over the utilization metric to see further details.\n\nCost optimization metrics will display for cluster modes as follows:\n\n- Standard clusters will always have used, requested and allocatable metrics visible at creation time due to the inclusion of managed GKE components in the overall calculation (kube-system namespace).\n\n\u003c!-- --\u003e\n\n- Autopilot clusters only display metrics when you deploy workloads with specified requests to the cluster. This is due to the [Autopilot pricing](/kubernetes-engine/pricing#autopilot_mode) model. Autopilot clusters don't show allocatable metrics because you only pay for resources requested by your running workloads.\n\nWorkloads deployed to Standard clusters that don't have requests or\nlimits specified, won't show a ratio on the chart. Instead, the bar chart\nwill represent just the workload usage metric.\n\nWorkloads deployed to Autopilot clusters that don't have requests or\nlimits specified, will have [default](/kubernetes-engine/docs/concepts/autopilot-overview#default_container_resource_requests)\nvalues applied to the containers, and will show the ratios at all times.\n\nWhat's next\n-----------\n\n- Learn about [Best practices for running cost-optimized applications on GKE](/architecture/best-practices-for-running-cost-effective-kubernetes-applications-on-gke).\n- Read the [Create a cost-optimized cluster in just a few clicks](/blog/products/containers-kubernetes/gke-setup-guide-automates-creation-of-cost-optimized-cluster) blog post.\n- Learn how to [view observability metrics](/kubernetes-engine/docs/how-to/view-observability-metrics)."]]