# Replication from AWS RDS to MySQL

**URL:** <https://forums.percona.com/t/replication-from-aws-rds-to-mysql/12348>\
**Category:** Percona Distribution for MySQL\
**Created:** [September 29, 2021, 11:55am UTC](https://forums.percona.com/t/replication-from-aws-rds-to-mysql/12348 "2021-09-29T11:55:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![j4nd3r53n](https://avatars.discourse-cdn.com/v4/letter/j/3d9bf3/32.png) [@j4nd3r53n](https://forums.percona.com/u/j4nd3r53n)\
**Post date:** [September 29, 2021, 11:55am UTC](https://forums.percona.com/t/replication-from-aws-rds-to-mysql/12348/1 "2021-09-29T11:55:06Z")

</div>

I’m having some serious trouble with replication - this is my setup:

As master, I have AWS RDS (MySQL 5.6), running on something large - about 2.7 TB of data and a lot of transactions coming in.

As slave, MySQL 5.6 running on an EC2 instance, fairly small, but with a reasonably fast disk. It is slowly lagging after the master - I can see the number of relay-log files is growing (currently \>4000). I have tried to spot a bottleneck using top, iotop and nethogs, but there doesn’t seem to any. Top shows the CPUs to be mostly idle (80%) or waiting (10%).

I can upgrade the EC2 instance, but I’m not sure what I should get more of - it already has 8 CPUs, 32 GB memory, fast disk and NIC, and as I understand it, MySQL 5.6 is only ever going to run 1 slave thread per database schema no matter what the value of `slave_parallel_workers`. What should I upgrade in order to get replication to perform better?

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [September 29, 2021, 1:33pm UTC](https://forums.percona.com/t/replication-from-aws-rds-to-mysql/12348/2 "2021-09-29T13:33:17Z")

</div>

You should upgrade both to 5.7 if possible. Otherwise, make sure sync\_binlog=0 on slave, innodb\_flush\_log\_at\_trx\_commit=0 on slave, make sure the specs of the slave match specs of RDS instance. Make sure config of EC2 matches RDS (buffer pool, redo logs, etc).
