Il motore per suggerimenti out-of-disk di Cloud SQL genera in modo proattivo
suggerimenti che ti aiutano a ridurre il rischio
di tempi di inattività che potrebbero essere causati dall'esaurimento dello spazio su disco delle istanze.
Puoi applicare questi suggerimenti quando un'istanza Cloud SQL si avvicina a un limite di archiviazione. Questa pagina descrive come funziona questo sistema di consigli e come
utilizzarlo.
Come funziona
Il motore per suggerimenti out-of-disk di Cloud SQL analizza il trend di utilizzo dello spazio di archiviazione
negli ultimi 30 giorni. Quando un'istanza si avvicina a un limite
in cui è probabile che lo spazio si esaurisca nei prossimi 1-30 giorni, il recommender
genera consigli correlati per aumentare manualmente la capacità di archiviazione, impostare
la capacità di archiviazione in modo che aumenti automaticamente o liberare spazio.
Nella scheda Previeni i tempi di inattività per le istanze SQL, fai clic su Visualizza tutto.
gcloud
Per elencare i suggerimenti relativi all'esaurimento dello spazio su disco utilizzando gcloud, esegui il comando
gcloud recommender recommendations list come segue:
gcloud recommender recommendations list \
--project=PROJECT_ID \
--location=LOCATION \
--recommender=google.cloudsql.instance.RECOMMENDER
Sostituisci quanto segue:
PROJECT_ID: il tuo ID progetto
LOCATION: una regione, ad esempio us-central1
RECOMMENDER: l'ID del motore per suggerimenti come OutOfDiskRecommender.
API
Per elencare i suggerimenti relativi all'esaurimento dello spazio su disco utilizzando l'API Recommendations, chiama il metodo recommendations.list nel seguente modo:
GET https://recommender.googleapis.com/v1beta1/projects/PROJECT-ID/locations/LOCATION/recommenders/google.cloudsql.instance.RECOMMENDER/recommendations
Sostituisci quanto segue:
PROJECT_ID: il tuo ID progetto.
LOCATION: una regione, ad esempio us-central1.
RECOMMENDER: l'ID del motore per suggerimenti come OutOfDiskRecommender.
Visualizzare approfondimenti e consigli dettagliati
Puoi visualizzare approfondimenti e consigli dettagliati sulle istanze
che stanno per esaurire lo spazio su disco utilizzando la console Google Cloud ,
gcloud o l'API Recommender.
Console
Per visualizzare approfondimenti e consigli dettagliati sulle istanze che stanno per esaurire lo spazio su disco utilizzando la console Google Cloud , fai clic sul pulsante dei consigli nell'elenco delle istanze.
gcloud
Per visualizzare approfondimenti e suggerimenti dettagliati sulle istanze che stanno per esaurire lo spazio su disco utilizzando gcloud, esegui il comando gcloud recommender insights list come segue:
gcloud recommender insights list \
--project=PROJECT_ID \
--location=LOCATION \
--insight-type=google.cloudsql.instance.INSIGHT_TYPE
Sostituisci quanto segue:
PROJECT_ID: il tuo ID progetto.
LOCATION: una regione, ad esempio us-central1.
INSIGHT_TYPE: l'ID del tipo di insight come DiskUsageTrendInsight.
API
Per visualizzare approfondimenti e suggerimenti dettagliati sulle istanze che stanno per esaurire lo spazio su disco utilizzando l'API Recommendations, chiama il metodo insights.list come segue:
GET https://recommender.googleapis.com/v1beta1/projects/PROJECT-ID/locations/LOCATION/insightTypes/google.cloudsql.instance.INSIGHT_TYPE/insights
Sostituisci quanto segue:
PROJECT_ID: il tuo ID progetto.
LOCATION: una regione, ad esempio us-central1.
INSIGHT_TYPE: l'ID del tipo di insight come DiskUsageTrendInsight.
La seguente tabella elenca l'insight e il suggerimento generati dal motore per suggerimenti
out-of-disk di Cloud SQL. I sottotipi sono visibili nei risultati dell'API e in gcloud.
Insight
Consiglio
In base all'attuale tendenza di utilizzo dello spazio di archiviazione, è probabile che l'istanza esaurisca lo spazio su disco, il che può comportare tempi di inattività.
Sottotipo: TRENDING_OUT_OF_DISK
Attiva l'aumento automatico, aumenta manualmente la capacità di archiviazione o libera spazio su disco.
Sottotipo: ENABLE_AUTO_STORAGE_INCREASE
Applica consigli
Valuta attentamente i consigli e procedi in uno dei seguenti modi:
Per esaminare il consiglio, fai clic su Visualizza istanza.
Nella parte superiore della pagina viene visualizzato un banner con un consiglio.
Modifica l'istanza, se necessario, per aumentare manualmente la capacità di archiviazione e impostare la capacità di archiviazione in modo che aumenti automaticamente.
In alternativa, elimina i dati per liberare spazio.
Per ignorare il consiglio in modo che venga messo in secondo piano e visualizzato in grigio,
fai clic su Ignora.
Per chiudere il riquadro senza applicare o ignorare il consiglio, fai clic su
Annulla.
[[["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-08-19 UTC."],[],[],null,["# Monitor disk availability\n\n\u003cbr /\u003e\n\n[MySQL](/sql/docs/mysql/using-ood-recommender \"View this page for the MySQL database engine\") \\| [PostgreSQL](/sql/docs/postgres/using-ood-recommender \"View this page for the PostgreSQL database engine\") \\| SQL Server\n\n\u003cbr /\u003e\n\nThe Cloud SQL out-of-disk [recommender](/recommender/docs/overview) proactively\ngenerates recommendations that help you reduce the risk\nof downtime that might be caused by your instances running out of disk space.\nYou can apply these recommendations when a Cloud SQL instance is trending\ntoward a storage limit. This page describes how this recommender works and how\nto use it.\n\nHow it works\n------------\n\nThe Cloud SQL out-of-disk recommender analyzes the storage utilization trend\nover the last 30 days. When an instance is trending toward a limit\nwhere it's likely to run out of space within the next 1 to 30 days, the recommender\ngenerates related recommendations to manually increase the storage capacity, set\nthe storage capacity to automatically increase, or free up space.\n\nPricing\n-------\n\nThe Cloud SQL out-of-disk recommender is included in the [Standard Google Cloud support package](/recommender/pricing).\n\nBefore you begin\n----------------\n\nBefore you can view recommendations and insights, do the following:\n\n- To get the permissions to view and work with insights and recommendations, ensure that you have the required [roles](/sql/docs/sqlserver/project-access-control#roles).\n\n For more information about roles, see [understanding roles](/iam/docs/understanding-roles) and [granting IAM permissions](/iam/docs/granting-changing-revoking-access).\n-\n\n\n Enable the Recommender API.\n\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=recommender.googleapis.com)\n\nList out-of-disk recommendations\n--------------------------------\n\nYou can list out-of-disk instance recommendations by\nusing the Google Cloud console, `gcloud`, or the Recommender API.\n\nOut-of-disk recommendations are shown only if you have instances that\nare nearing disk capacity. \n\n### Console\n\nTo list out-of-disk recommendations by using the Google Cloud console, follow these steps:\n\n1. Go to the **Cloud SQL Instances** page.\n\n [Go to Cloud SQL Instances](https://console.cloud.google.com/sql/instances)\n2. Click **View all** on the out-of-disk recommendations banner.\n\nAlternatively, follow these steps:\n\n1. Go to the **Recommendation Hub** . See also [Getting started with Recommendation Hub](/recommender/docs/recommendation-hub/identify-configuration-problems).\n\n [Go to the Recommendation Hub](https://console.cloud.google.com/home/recommendations/)\n2. In the **Prevent Downtime for SQL instances** card, click **View all**.\n\n### gcloud\n\nTo list out-of-disk recommendations by using `gcloud`, run the\n[`gcloud recommender recommendations list`](/sdk/gcloud/reference/recommender/recommendations/list)\ncommand as follows: \n\n```\ngcloud recommender recommendations list \\\n--project=PROJECT_ID \\\n--location=LOCATION \\\n--recommender=google.cloudsql.instance.RECOMMENDER\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your project ID\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: A region, such as `us-central1`\n- \u003cvar translate=\"no\"\u003eRECOMMENDER\u003c/var\u003e: The ID of the recommender as `OutOfDiskRecommender`.\n\n### API\n\nTo list out-of-disk recommendations by using the\n[Recommendations API](/recommender/docs/using-api), call the\n[`recommendations.list`](/recommender/docs/reference/rest/v1beta1/projects.locations.recommenders.recommendations/list)\nmethod as follows: \n\n```\nGET https://recommender.googleapis.com/v1beta1/projects/PROJECT-ID/locations/LOCATION/recommenders/google.cloudsql.instance.RECOMMENDER/recommendations\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your project ID.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: A region, such as `us-central1`.\n- \u003cvar translate=\"no\"\u003eRECOMMENDER\u003c/var\u003e: The ID of the recommender as `OutOfDiskRecommender`.\n\nView insights and detailed recommendations\n------------------------------------------\n\nYou can view insights and detailed recommendations about instances\nthat are nearly out of disk space by using the Google Cloud console,\n`gcloud`, or the Recommender API. \n\n### Console\n\nTo view insights and detailed recommendations about instances that are nearly\nout of disk space by using the Google Cloud console, click the recommendation\nbutton in the list of instances.\n\n### gcloud\n\nTo view insights and detailed recommendations about instances that are nearly\nout of disk space by using `gcloud`, run the\n[`gcloud recommender insights list`](/sdk/gcloud/reference/recommender/insights/list)\ncommand as follows: \n\n```\ngcloud recommender insights list \\\n--project=PROJECT_ID \\\n--location=LOCATION \\\n--insight-type=google.cloudsql.instance.INSIGHT_TYPE\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your project ID.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: A region, such as `us-central1`.\n- \u003cvar translate=\"no\"\u003eINSIGHT_TYPE\u003c/var\u003e: The ID of the insight type as `DiskUsageTrendInsight`.\n\n### API\n\nTo view insights and detailed recommendations about instances that are nearly\nout of disk space by using the [Recommendations API](/recommender/docs/using-api),\ncall the [`insights.list`](/recommender/docs/reference/rest/v1beta1/projects.locations.insightTypes.insights/list)\nmethod as follows: \n\n```\nGET https://recommender.googleapis.com/v1beta1/projects/PROJECT-ID/locations/LOCATION/insightTypes/google.cloudsql.instance.INSIGHT_TYPE/insights\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your project ID.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: A region, such as `us-central1`.\n- \u003cvar translate=\"no\"\u003eINSIGHT_TYPE\u003c/var\u003e: The ID of the insight type as `DiskUsageTrendInsight`.\n\nThe following table lists the insight and recommendation that the Cloud SQL\nout-of-disk recommender generates. The subtypes are visible in the `gcloud` and\nAPI results.\n\nApply recommendations\n---------------------\n\nEvaluate the recommendations carefully and do any of the following:\n\n- To examine the recommendation, click **View instance**.\n\n A banner appears at the top of the page providing a recommendation.\n\n [Edit](/sql/docs/sqlserver/edit-instance) the instance, if required, to [manually increase](/sql/docs/sqlserver/instance-settings#storage-capacity-2ndgen) the storage capacity and set the storage\n capacity to [automatically increase](/sql/docs/sqlserver/instance-settings#storage-capacity-2ndgen).\n Alternatively, delete data to free up space.\n- To dismiss the recommendation so that it's de-emphasized and appears dimmed,\n click **Dismiss**.\n\n- To close the panel without applying or dismissing the recommendation, click\n **Cancel**.\n\nWhat's next\n-----------\n\n- [Reduce idle Cloud SQL instances](/sql/docs/sqlserver/recommender-sql-idle)\n- [Reduce overprovisioned Cloud SQL instances](/sql/docs/sqlserver/recommender-sql-overprovisioned)\n- [Blog: Maximize your Cloud ROI](https://cloud.google.com/blog/products/management-tools/active-assist-comes-to-google-cloud)\n- [Blog: Do more with less](https://cloud.google.com/blog/products/databases/reduce-cloud-sql-costs-with-optimizations-by-active-assist)\n- [Google Cloud recommenders](/recommender/docs/recommenders)"]]