Migliorare le prestazioni con AlloyDB per PostgreSQL
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
MySQL | PostgreSQL | SQL Server
Questa pagina descrive come visualizzare e implementare i suggerimenti relativi al suggeritore Cloud SQL Migrate to AlloyDB per PostgreSQL. Questo sistema di suggerimenti ti aiuta a rilevare le istanze con le seguenti caratteristiche:
L'istanza è critica.
La percentuale di successo della cache è bassa, il che può influire sulle prestazioni.
Ogni giorno, questo sistema di suggerimenti analizza in modo proattivo i metadati e le metriche dell'istanza relativi al tasso di successo della cache e fornisce approfondimenti e consigli
per migliorare il rendimento dell'istanza. Puoi visualizzare questi approfondimenti e suggerimenti utilizzando la console Google Cloud ,gcloud CLI o l'API Recommender.
Se la tua istanza è un'istanza di produzione e la percentuale di successi della cache è bassa, ti consigliamo di eseguire la migrazione ad AlloyDB per PostgreSQL per migliorare le prestazioni.
I consigli vengono generati ogni giorno.
Elenca i consigli per il rendimento per la migrazione ad AlloyDB per PostgreSQL
Puoi elencare le raccomandazioni per la migrazione ad AlloyDB per PostgreSQL per migliorare le prestazioni
utilizzando la Google Cloud console, gcloud CLI o l'API Recommender.
Console
Per elencare i consigli per l'upgrade ad AlloyDB per PostgreSQL, segui questi passaggi:
GET https://recommender.googleapis.com/v1beta1/projects/PROJECT_ID/locations/LOCATION/recommenders/google.cloudsql.instance.PerformanceRecommender/recommendations
Sostituisci quanto segue:
PROJECT_ID: il tuo ID progetto.
LOCATION: una regione in cui si trovano le istanze, ad esempio us-central1.
Se il sistema di suggerimenti rileva istanze che possono essere aggiornate ad AlloyDB per PostgreSQL, queste vengono visualizzate in una tabella. Ogni riga mostra il nome dell'istanza, un breve consiglio, la posizione e la data dell'ultimo aggiornamento.
Visualizzare approfondimenti e consigli dettagliati
Puoi visualizzare approfondimenti e consigli dettagliati sulle istanze che possono essere aggiornate ad AlloyDB per PostgreSQL utilizzando la console Google Cloud , gcloud CLI o l'API Recommender.
Console
Esegui una di queste operazioni:
Nella pagina Consigli per il rendimento, fai clic sulla scheda Consigli per il rendimento e poi su Esegui la migrazione ad AlloyDB.
Viene visualizzato il riquadro dei suggerimenti, che contiene approfondimenti e suggerimenti dettagliati per l'istanza.
Nella pagina Istanze, fai clic su Esegui la migrazione ad AlloyDB. L'elenco delle istanze mostra solo quelle a cui si applica il consiglio.
GET https://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/insightTypes/google.cloudsql.instance.PerformanceInsight/insights
Sostituisci quanto segue:
PROJECT_ID: il tuo ID progetto.
LOCATION: una regione in cui si trovano le istanze, ad esempio us-central1.
Viene visualizzato un riquadro che mostra approfondimenti sulle metriche o informazioni evidenziate da Approfondimenti.
Applica consigli
Per implementare questo consiglio:
Per eseguire l'upgrade ad AlloyDB per PostgreSQL:
Fai clic su Esegui la migrazione ad AlloyDB nella colonna Problemi. Viene visualizzata una finestra Esegui l'upgrade ad AlloyDB che fornisce un suggerimento.
Per procedere con l'upgrade, fai clic su Modifica > Upgrade.
[[["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-04 UTC."],[],[],null,["# Improve performance with AlloyDB for PostgreSQL\n\n\u003cbr /\u003e\n\nMySQL \\| PostgreSQL \\| SQL Server\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| You can process personal data for this feature as outlined in the\n| [Cloud Data Processing\n| Addendum](/terms/data-processing-addendum), subject to the obligations and restrictions described in the agreement under\n| which you access Google Cloud.\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\nThis page describes how to view and implement recommendations about the Cloud SQL Migrate to AlloyDB for PostgreSQL [recommender](/recommender/docs/overview). This recommender helps you detect instances with the following characteristics:\n\n- The instance is critical.\n- The cache hit rate is low, which can affect performance.\n\nEvery day, this recommender proactively analyzes instance metadata and metrics about cache hit rate and provides insights and recommendations\nto improve your instance performance. You can view these insights and recommendations using the Google Cloud console,\n[gcloud CLI](/sdk/gcloud), or the [Recommender API](/recommender/docs/using-api).\n\nIf your instance is a production instance and its cache hit rate is low, then we recommended that you migrate to AlloyDB for PostgreSQL to improve performance.\nRecommendations are generated daily.\n\nPricing\n-------\n\nThe recommenders described on this page are all in the standard [Recommender pricing tier](/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/postgres/project-access-control#roles).\n\n For more information about roles, see [understanding roles](/iam/docs/understanding-roles) and [granting Identity and Access Management (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\n### List performance recommendations for migrating to AlloyDB for PostgreSQL\n\nYou can list migrate to AlloyDB for PostgreSQL recommendations for improving performance\nusing the Google Cloud console, [gcloud CLI](/sdk/gcloud), or the Recommender API. \n\n### Console\n\nTo list upgrade to AlloyDB for PostgreSQL recommendations, 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. In the **Improve instance health by investigating issues and acting on\n recommendations** banner, click **Expand Details**.\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 [Getting started with the Recommendation Hub](/recommender/docs/recommendation-hub/identify-configuration-problems).\n2. In the **All recommendations** card, click **Performance**.\n\n### gcloud\n\nRun the [`gcloud recommender insights list`](/sdk/gcloud/reference/recommender/insights/list) command as follows: \n\n```\ngcloud recommender recommendations list \\\n--project=PROJECT_ID \\\n--location=LOCATION \\\n--recommender=google.cloudsql.instance.PerformanceRecommender \\\n--filter=recommenderSubtype=MIGRATE_TO_ALLOYDB\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 where your instances are located, such as `us-central1`.\n\n### API\n\nCall the [`insights.list`](/recommender/docs/reference/rest/v1/projects.locations.insightTypes.insights/list) method as follows: \n\n```\nGET https://recommender.googleapis.com/v1beta1/projects/PROJECT_ID/locations/LOCATION/recommenders/google.cloudsql.instance.PerformanceRecommender/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 where your instances are located, such as `us-central1`.\n\nIf the recommender detects instances that can be upgraded to AlloyDB for PostgreSQL, then those instances appear in a table. Each row shows the instance name, a brief recommendation, the location, and the last refresh date.\n\n### View insights and detailed recommendations\n\nYou can view insights and detailed recommendations about instances that can be upgraded to AlloyDB for PostgreSQL using the Google Cloud console, [gcloud CLI](/sdk/gcloud), or the Recommender API. \n\n### Console\n\nDo one of the following:\n\n- On the **Performance Recommendations** page, click the **Performance\n recommendations** card and then click **Migrate to AlloyDB**.\n The recommendation panel appears, which contains insights and detailed\n recommendations for the instance.\n\n- On the **Instances** page, click **Migrate to AlloyDB**. The\n list of instances displays only those instances for which the\n recommendation applies.\n\n### gcloud\n\nRun the [`gcloud recommender insights list`](/sdk/gcloud/reference/recommender/insights/list) command as follows: \n\n```\ngcloud recommender insights list \\\n--project=PROJECT_ID \\\n--location=LOCATION \\\n--insight-type=google.cloudsql.instance.PerformanceInsight\n--filter=insightSubtype=READ_HEAVY_WORKLOAD\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 where your instances are located, such as `us-central1`.\n\n### API\n\nCall the [`insights.list`](/recommender/docs/reference/rest/v1/projects.locations.insightTypes.insights/list) method as follows: \n\n```\nGET https://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/insightTypes/google.cloudsql.instance.PerformanceInsight/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 where your instances are located, such as `us-central1`.\n\nA panel appears showing insights about metrics or information that the Insights highlight.\n\n### Apply recommendations\n\nTo implement this recommendation, do the following:\n\n- To upgrade to AlloyDB for PostgreSQL:\n 1. Click **Migrate to AlloyDB** in the **Issues** column. An **Upgrade to AlloyDB** window displays providing a recommendation.\n 2. To proceed with an upgrade, click **Edit** \\\u003e **Upgrade**.\n- For more information about AlloyDB for PostgreSQL, see the [AlloyDB for PostgreSQL documentation](/alloydb/docs).\n\nWhat's next\n-----------\n\n- [Google Cloud recommenders](/recommender/docs/recommenders)\n- [About database observability](/sql/docs/postgres/observability)"]]