L'outil de recommandation pour les instances sous-provisionnées vous aide à détecter les instances qui sollicitent intensivement les ressources processeur et/ou mémoire.
Il vous fournit ensuite des recommandations pour optimiser ces instances.
Cette page décrit le fonctionnement de cet outil de recommandation et son utilisation.
Fonctionnement
En cas de sollicitation intensive des ressources processeur et/ou mémoire, une recommandation s'affiche, vous invitant à augmenter la taille de l'instance afin de réduire l'utilisation des ressources processeur et/ou mémoire lors des pics d'activité.
gcloud recommender recommendations list \
--project=PROJECT_ID \
--location=LOCATION \
--recommender=google.cloudsql.instance.UnderprovisionedRecommender
Remplacez les éléments suivants :
PROJECT_ID : ID de votre projet
LOCATION : une région, telle que us-central1
API
Pour lister les recommandations concernant les instances sous-provisionnées à l'aide de l'API Recommendations, appelez la méthode recommendations.list comme suit :
GET https://recommender.googleapis.com/v1beta1/projects/PROJECT-ID/locations/LOCATION/recommenders/google.cloudsql.instance.UnderprovisionedRecommender/recommendations
Remplacez les éléments suivants :
PROJECT_ID : ID de votre projet
LOCATION : une région, telle que us-central1
Si l'outil de recommandation détecte des instances sous-provisionnées, il les liste dans une table. Chaque ligne indique le nom de l'instance, une brève recommandation, le type de machine actuel, le type de machine recommandé, l'emplacement et la date de la dernière actualisation.
Afficher les insights et les recommandations détaillées
Console
Pour afficher des insights et des recommandations détaillées sur une instance sous-provisionnée à l'aide de la consoleGoogle Cloud , cliquez sur le bouton de recommandation dans la liste des instances.
gcloud
Pour afficher les insights et les recommandations détaillées concernant les instances sous-provisionnées à l'aide de gcloud, exécutez la commande gcloud recommender insights list comme suit :
gcloud recommender insights list \
--project=PROJECT_ID \
--location=LOCATION \
--insight-type=google.cloudsql.instance.INSIGHT_TYPE
Remplacez les éléments suivants :
PROJECT_ID : ID de votre projet
LOCATION : une région, telle que us-central1
INSIGHT_TYPE : ID du type d'insight, pouvant être UnderprovisionedCpuUsageInsight, UnderprovisionedMemoryUsageInsight ou OomProbabilityInsight, et qui fournissent respectivement des insights sur l'utilisation du processeur, la mémoire et la probabilité d'un événement de mémoire insuffisante (OOM).
API
Pour afficher les insights et les recommandations détaillées concernant les instances sous-provisionnées à l'aide de l'API Recommendations, appelez la méthode insights.list comme suit :
GET https://recommender.googleapis.com/v1beta1/projects/PROJECT-ID/locations/LOCATION/insightTypes/google.cloudsql.instance.INSIGHT_TYPE/insights
Remplacez les éléments suivants :
PROJECT_ID : ID de votre projet
LOCATION : une région, telle que us-central1
INSIGHT_TYPE : ID du type d'insight, pouvant être UnderprovisionedCpuUsageInsight, UnderprovisionedMemoryUsageInsight ou OomProbabilityInsight, et qui fournissent respectivement des insights sur l'utilisation du processeur, la mémoire et la probabilité d'un événement de mémoire insuffisante (OOM).
Le tableau suivant liste les insights et les recommandations que l'outil de recommandation pour les instances Cloud SQL sous-provisionnées peut générer pour vous aider à éviter les goulots d'étranglement liés à une utilisation élevée du processeur et de la mémoire, et à réduire la probabilité d'événements de mémoire insuffisante.
Les sous-types sont visibles dans les résultats gcloud et de l'API.
Insights
Recommandations
Sur la base des tendances d'utilisation actuelles du processeur, l'instance est signalée comme sollicitant intensivement le processeur. Sous-type : HIGH_CPU_UTILIZATION.
Augmentez la taille du processeur ou réduisez son utilisation. Sous-type : CHANGE_INSTANCE_SIZE.
Sur la base des tendances d'utilisation actuelles de la mémoire, l'instance est signalée comme sollicitant intensivement la mémoire. Sous-type : HIGH_MEMORY_UTILIZATION.
Augmentez la taille de la mémoire ou réduisez son utilisation. Sous-type : CHANGE_INSTANCE_SIZE.
Sur la base des tendances d'utilisation actuelles, l'instance est signalée comme présentant un risque d'événements OOM. Sous-type : HIGH_OOM_PROBABILITY.
Augmentez la taille de la mémoire ou réduisez son utilisation. Sous-type : CHANGE_INSTANCE_SIZE.
Appliquer les recommandations
Étudiez attentivement les recommandations et effectuez l'une des opérations suivantes :
Pour examiner la recommandation, cliquez sur Afficher l'instance.
Une bannière comportant une recommandation s'affiche en haut de la page.
Pour ignorer la recommandation afin qu'elle ne soit plus mise en évidence et apparaisse grisée, cliquez sur Ignorer.
Pour fermer le panneau sans appliquer ni ignorer la recommandation, cliquez sur Annuler.
Optimiser les performances de votre instance
Pour optimiser les performances de votre instance, procédez comme suit :
Modifiez l'instance, si nécessaire, pour augmenter le nombre de processeurs virtuels ou la quantité de mémoire. Vous pouvez également passer à un type de machine comportant plus de processeurs virtuels et plus de mémoire. Vous n'avez pas besoin de redimensionner l'instance exactement comme recommandé. Évaluez la situation et redimensionnez l'instance selon la manière dont vous prévoyez de la provisionner.
N'oubliez pas que plus la taille est grande, plus la latence opérationnelle est importante.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/04 (UTC)."],[],[],null,["# Reduce underprovisioned Cloud SQL instances\n\n\u003cbr /\u003e\n\n[MySQL](/sql/docs/mysql/recommender-underprovisioned \"View this page for the MySQL database engine\") \\| [PostgreSQL](/sql/docs/postgres/recommender-underprovisioned \"View this page for the PostgreSQL database engine\") \\| SQL Server\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n|\n| **Preview**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nThe underprovisioned instance [recommender](/recommender/docs/overview)\nhelps you detect instances that have high CPU and/or memory utilization.\nIt then provides recommendations for how to optimize the instance.\nThis page describes how this recommender works and how to use it.\n\nHow it works\n------------\n\nWhen there is high CPU and/or memory utilization detected, you see a recommendation to increase the size of your instance to reduce CPU and/or memory utilization at peak.\n| **Note:** Recommendations are generated daily.\n\nPricing\n-------\n\nThe underprovisioned instance recommender is in the Standard\n[Recommender pricing tier](/recommender/pricing).\n\nBefore you begin\n----------------\n\nBefore you can view recommendations and insights, do the following:\n\n- Ensure that you have the required [roles](/sql/docs/sqlserver/project-access-control#roles) so that you have permission to view and work with insights and recommendations.\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 underprovisioned instance recommendations\n----------------------------------------------\n\n### Console\n\nTo list recommendations about underprovisioned instances, 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 resize Cloud SQL instance recommender banner.\n\nAlternatively, follow these steps:\n\n1. Go to the **Recommendation Hub**.\n\n [Go to the Recommendation Hub](https://console.cloud.google.com/home/recommendations/)\n\n For more information, see\n [Getting started with Recommendation Hub](/recommender/docs/recommendation-hub/identify-configuration-problems).\n2. In the **Resize Cloud SQL instances to improve performance** card, click **View all**.\n\n3. Click the instances with the **Resize Cloud SQL instance** recommendation.\n\n### gcloud\n\nTo list recommendations about underprovisioned instances, 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.UnderprovisionedRecommender\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\n### API\n\nTo list recommendations about underprovisioned instances 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.UnderprovisionedRecommender/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\nIf the recommender detects underprovisioned instances, it lists them in a\ntable. Each row shows the instance name, a brief recommendation, the current machine type,\nthe recommended machine type, the location, and the last refresh date.\n\nView insights and detailed recommendations\n------------------------------------------\n\n### Console\n\nTo view insights and detailed recommendations about an underprovisioned instance by using the\nGoogle Cloud console, click the recommendation button in the list of instances.\n\n### gcloud\n\nTo view insights and detailed recommendations about underprovisioned instances 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 is `UnderprovisionedCpuUsageInsight`, `UnderprovisionedMemoryUsageInsight`, or `OomProbabilityInsight`, which provide insights about CPU usage, memory, and OOM probability, respectively.\n\n### API\n\nTo view insights and detailed recommendations about underprovisioned instances by using the\n[Recommendations API](/recommender/docs/using-api), call the\n[`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 \\``UnderprovisionedCpuUsageInsight`, `UnderprovisionedMemoryUsageInsight`, or `OomProbabilityInsight`, which provide insights about CPU usage, memory, and OOM probability, respectively.\n\nThe following table lists the insights and recommendations that the Cloud SQL\nunderprovisioned instance recommender might generate to help you avoid bottlenecks from high CPU and memory\nusage and minimize the likelihood of out-of-memory events.\nThe subtypes are visible in the `gcloud` and API 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- 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\n### Optimize the performance of your instance\n\nTo optimize your instance's performance, do the following:\n\n- [Optimize high memory usage](/sql/docs/sqlserver/optimize-high-memory-usage)\n\n- [Optimize high CPU usage](/sql/docs/sqlserver/optimize-cpu-usage)\n\n\u003c!-- --\u003e\n\n- [Edit](/sql/docs/sqlserver/edit-instance) the instance, if required, to\n increase the vCPUs or memory. Alternatively, switch to a machine type with more\n vCPUs and more memory. You don't need to rightsize the instance exactly as recommended. Use your\n judgement and resize based on how you intend to provision the instance.\n Keep in mind that the bigger the size, the greater the operational latency.\n\n | **Caution:** This operation can lead to an increase in cost. Additionally, it triggers a restart, which brings downtime to the instance.\n\nYou can also [export these recommendations to BigQuery](/recommender/docs/bq-export/export-recommendations-to-bq)\nand then examine them using [Looker Studio](/bigquery/docs/visualize-looker-studio) or [Looker](/bigquery/docs/looker).\n\nWhat's next\n-----------\n\n- [Monitor disk availability](/sql/docs/sqlserver/using-ood-recommender)\n- [Reduce idle Cloud SQL instances](/sql/docs/sqlserver/recommender-sql-idle)\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)"]]