Use assessments in Database Center to assess and test the performance impact of database recommendations before you apply them to your production database fleet.
To assess recommendations, the assessments performs these operations:
Clones your database instance.
Runs benchmarking simulation tests on the clone.
Compares the baseline performance of the clone against the performance after you apply the recommended configuration changes.
Supported products and recommendations
Database Center assessments are available only for Cloud SQL for PostgreSQL instances.
You can assess the following types of recommendations:
Compute resource expansion: Evaluates the impact of resizing instances to machine types with more vCPUs or memory.
Edition upgrade: Assesses the performance impact of migrating from the Cloud SQL Enterprise edition to the Cloud SQL Enterprise Plus edition of Cloud SQL for PostgreSQL. For details, see Upgrade an instance to Cloud SQL Enterprise Plus edition in place.
Data cache activation: Analyzes the latency and throughput implications of enabling the data cache.
Before you begin
Ensure that you meet the following requirements before you run a recommendation assessment:
API enablement: Enable the following APIs:
- Cloud SQL Admin API (
sqladmin.googleapis.com) - Cloud Run Admin API (
run.googleapis.com) - Cloud Logging API (
logging.googleapis.com) - Gemini Cloud Assist API
(
geminicloudassist.googleapis.com) - Secret Manager API
(
secretmanager.googleapis.com) - Cloud Monitoring API (
monitoring.googleapis.com)
See Enabling and disabling APIs to enable APIs.
- Cloud SQL Admin API (
Database connection credentials: You must provide the target database name and a database username.
Secret Manager secret: You must store the password for your database username in a global Secret Manager secret and know the name of the secret so you can search for it in the secret picker. You only need the full secret path if the secret doesn't appear in the list. For more information about creating secrets, see Creating and accessing secrets.
Service account: Configure an Identity and Access Management (IAM) service account for the environment to benchmark and compare baseline performance against recommended changes. This service account requires permissions to read the database credentials secret from Secret Manager and to coordinate benchmarking tasks in Cloud Run. See Creating a service account to configure service accounts.
IAM permissions: You must have the required IAM permissions to initiate and manage the testing process. For more information, see Required IAM permissions.
Assess a recommendation
Follow these steps to assess and test a recommendation:
Go to the Database Center page in the Google Cloud console.
Click Assessments in the navigation menu.
Locate a supported recommendation for a Cloud SQL for PostgreSQL instance.
Click Assess impact in the Implications column for that recommendation.
If you haven't enabled the required APIs, follow the guidance in the panel to enable them.
On the Assessment details page, enter the following connection details in the configuration panel:
In Database, enter the name of the database. Valid options correspond to the databases listed on the Databases page of your Cloud SQL instance.
In Username, enter the database username.
In Password secret, select the Secret Manager secret containing the database user password.
If the secret doesn't appear in the list, enter the secret path manually in the format
projects/PROJECT_ID/secrets/SECRET_NAME. ReplacePROJECT_IDwith your project ID andSECRET_NAMEwith the name of the secret. By default, Database Center uses the latest version of the secret. You can optionally specify a version by appending/versions/VERSIONto the path, replacingVERSIONwith the version of the secret.In Service account, select the service account to use for running the benchmarking jobs.
Click Generate test plan. Generating the plan takes a few minutes.
Database Center generates a test plan preview showing the sequence of steps to clone the database, run pgbench workloads, apply the recommendation, and analyze performance.
Database Center lists the session on the Assessments page when it generates the plan. You can safely navigate away from the page and return to the session later.
To refine the test plan, in the Test instructions field, enter instructions (for example,
Change the benchmark duration to 60 seconds), and then click Update test plan.Click Start assessment. In the confirmation dialog, review the billing notice. Provisioning the cloned instance and running benchmark jobs are billable within your project.
The assessment session is available for 48 hours. Database Center automatically deletes the cloned instance after a successful assessment. If the assessment fails, the cloned instance isn't deleted automatically, and you must delete it manually.
Click Confirm to start the evaluation. The assessment process takes some time to complete.
Database Center displays the assessment progress. You can safely leave the page while the session runs in the background.
View assessment history and reports
Manage evaluations and review performance comparison reports by tracking assessment sessions. Database Center retains session reports and metadata for 48 hours and displays an expiration countdown for each session.
In the Google Cloud console, go to the Database Center page.
In the navigation menu, click Assessments.
In the sessions list, click the Session ID of the session to view its details.
The following table describes the assessment session statuses, the information displayed for each status, and the available actions:
Status Displayed information Available actions Planning phase Test plan details and preview. Refine the test plan preview using the Test instructions field, or click Start assessment to begin the assessment. Assessment phase The assessment progress and the test plan used by the assessment. Click Cancel to cancel the assessment. Completed A summary that compares database performance before and after applying the recommendation. None Canceled The progress of the assessment before it was canceled. None Generation failed Generation of the test plan failed. You can view test plan details and configuration fields, such as the database name and secret name, to retry generating the test plan. Update the assessment configuration settings, such as database name and username, and retry the test plan generation. Assessment failed The assessment of the recommendation failed. You can view the error message and the progress of the assessment before it failed. None
Cancel a session or clean up failed sessions
If you cancel an assessment session in progress or if the execution fails, verify that all temporary resources are removed. Because Database Center can't confirm whether cleanup succeeded after a failure or cancellation, check for and delete remaining database clone instances for all failed and canceled sessions.
Cancel a session: On the Assessments page, click the session ID of the assessment you want to cancel, then click Cancel. To cancel a session, its session ID must have a status of Assessment phase.
Clean up cloned resources:
To manually delete the cloned instance:
In the Google Cloud console, go to the Cloud SQL Instances page.