Home > OS >  GCP Cloud SQL database export takes a lot of time
GCP Cloud SQL database export takes a lot of time

Time:01-19

When I try to export large database (approximate size ~8Tb) to the bucket, the process takes about 12 hours. Due to the SQL Server logs backup finished after ~3 hours, but in the Operations pane I see that export process still working and I have no idea what happens the rest of time on server side. For example the import process for the same database takes ~4 hours. SQL instance has 24 vcpu and 64Gb memory, all metrics looks good during export process.

SQL server logs: enter image description here

Operations log: enter image description here

CodePudding user response:

If the export takes to much time , you could check if you have the Compression mode enable because this can degrade export performance. Also you can review this link with some best practices to importing and exporting data with Cloud SQL.

CodePudding user response:

You can see Cloud SQL for SQL server as a Google-managed virtual machine that within it has a SQL server instance.
As you have already noticed, part of the export is to first back up the database and then upload it to a Cloud Storage bucket.
If the backup is taking 3 hours out of the total 12, then that tells me that the remainder is time mostly spent on uploading the backup file from the Cloud SQL vm instance to the Cloud Storage bucket.

As you well know high-speed internet connections are asymmetric — they are designed to provide much better speed for downloading than uploading.
Importing from a Cloud Storage bucket does not involve backing up the database, so this means 3 hours less in comparison with the export.
What I am trying to say is that you cannot expect the same operation duration for Cloud SQL exports and imports.

Uploading 8 terabytes in about 9 hours is the same as uploading 14 Gib per minute; this transfer rate can vary as it is managed by Google because Cloud SQL is a Google-managed product.
If you require a higher transfer rate or an option to configure it, you can open a feature request here.

As of now to improve the Cloud SQL export operation time you can follow the best practices.
You can also make sure that the export bucket is in the same or closest region to your Cloud SQL instance; that should reduce the number of hops the backup file needs to go through.

  •  Tags:  
  • Related