mysql – AWS RDS mysqldump is slowing down

I'm taking a db backup of the AWS RDS slave (MySQL) from an EC2 (m5.large – 2c / 8GB) on the same AZ using –

mysqldump -hxx -u xx -p - extension-insertion --single-transaction --max_allowed_packet = 1G db> db.sql

The backup dies in around 60-70 minutes with error: mysqldump: Error 2013: the connection to the MySQL server was lost during the query when dump table xx in the row: 1743503

  1. The error row changes, but the table is the same as mysqldump produces errors
  2. The table has 4M records and the size is around 1.5 GB
  3. The max_allowed_packet package in the source is 4 MB (although I think this is inconsequential)

So I tried with a backup table with pv enabled:

mysqldump -hxx -u xx -p - extension-insertion --single-transaction --max_allowed_packet = 1G db tbl_xx | pv> db_tbl_xx.sql

The pv transmission was interesting since I saw ~ 10 MiB / s of speed for some time, then it froze at 0 B / s for a few seconds. When it was resumed, it remained around 700-800 KiB / s for the rest of the time until the backup finished (1.79 GB – 35 minutes). Only in the case of a complete database, the backup never finished, but he died, launching the "Error 2013".

Interestingly, a backup of the SQLyog GUI for the same table ended in about 5 minutes over the Internet.

I am not sure if the mysqldump parameters are not compatible with the large backups or if the problem is in some network level configuration.
Any help with the pointers to verify anywhere will be great, thanks!