Kévin HERRERO
Kévin HERRERO

Reputation: 241

MySQL Workbench low migration speed

I'm using MySQLWorkbench (8.0.25) in order to migrate data from a database to another database on the same server and it takes 10mins+ to do so, which seems like a very long time.

The database, on AWS, is a single AZ db.t2.micro database located in Paris, eu-west-3.

Using speedtest.net, it seems I have 25Mb/s download and around the same upload speed, and it does feel like it as I'm browsing. I am very far from the datacenter (I'm in Buenos Aires and it's in Paris) but I always have a VPN turned on whose t2.small server is located in the same datacenter as the database (eu-west-3). In particular, the VPN was on during the test, so the 25Mb/s should be representative of what I can expect during a migration of the eu-west-3 database.

The database is of reasonable size: when I export my database from MySQL workbench, the total dump size is 26Mb.

I'm currently living in Buenos Aires. When I was in France, this migration would take around 30s (I had 150Mb/s download back then and probably like 50Mb upload).

Could you help me understand why it takes so much time despite the still decent internet I have here? Thanks in advance.

Upvotes: 0

Views: 212

Answers (1)

Riz
Riz

Reputation: 1167

I can't write all in a comment so I am gonna reply here. I am not familair with MySQLWorkbench so I don't know how it does the migration. I would like you to do the migration through cli and see if the issue really is RDS.
I have this script(taken from this forum a while ago and don't remember the source) which does this migration very easily.
If the destination database is present, you need to either rename it(here is how) or delete it all together(drop database $dbname;).
Create a bash script in the instance from where you can access the RDS and copy the following into it.

    #!/bin/bash
    start=`date +%s`
    set -e 
     
    mysqlconn="mysql -u $rootuser -ppassword -h $hostname"
    olddb=$1
    newdb=$2
    $mysqlconn -e "CREATE DATABASE $newdb"
    params=$($mysqlconn -N -e "SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES \
                               WHERE table_schema='$olddb'")
    for name in $params; do
          $mysqlconn -e "RENAME TABLE $olddb.$name to $newdb.$name";
    done;
    $mysqlconn -e "DROP DATABASE $olddb"
    end=`date +%s`
    runtime=$((($(date +%s)-$start)/60))
    echo "Total time taken is ${runtime} minutes"
    

You can run it as $scriptname.sh $olddb $newdb. If it takes more time then you try with nohup $scriptname.sh $olddb $newdb &.
This way you can be sure that the culprit is mysqlworkbenchand not RDS.

Upvotes: 1

Related Questions