I'm running a MariaDB 10.1.34 instance on AWS RDS. Instance specs are as follows:
- Instance Class: db.t2.large
- Storage: 100GiB gp2
- DB Size: 1.2 GiB
I'm trying to create a mysqdump from an EC2 instance located in the same availability zone as the db. While this works, the performance is extremely bad. It takes around 15 minutes to dump the database ( which is only 1.2 GiB in size ) with mysqldump.
I've been monitoring disk and network usage on the ec2 instance. In the first 5 seconds of mysqldump, network usage spikes around 600 Mbit/s and then dropping to only around 200 kbit/s. Same with the disk usage.
Strangely, rebooting the Database instance seems to fix the behaviour temporarily. mysqldump finished in 30 seconds one time, and became slow again afterwards.
The Write IOPS on the DB instance hover around 10 - 15, Read iops only exceeded 20 after restarting the instance.
I'd be grateful for any advice on how to debug this issue further.
I should also add my mysqldump command:
ubuntu@server:~$ mysqldump --version mysqldump Ver 10.13 Distrib 5.7.23, for Linux (x86_64) ubuntu@server:~$ mysqldump -h <db_host> -p -P 3306 -u <read_only_user> --quick --single-transaction --skip-lock-tables <database> > dump.sql