There is no straightforward way to figure out the slow performance issue between AWS services, but we can drill down one by one doing following checks.
Check the computing capacity, network speed/bandwidth, and storage type of your AWS EC2 instance, if it's a low configuration instance, then replace the AWS EC2 instance with next possible higher configuration.
Similarly, if you are running a low configuration AWS RDS instance, the request and response payload could be the issue. Replace the AWS RDS instance with next possible higher configuration.
Sometimes, the CPU utilization of AWS EC2 instance spikes. Usually, it happens due to the app service, which opens/closes multiple file descriptors unnecessarily. It's the developer's mistake must be fixed immediately.
Sometimes, the memory utilization of AWS EC2 instance spikes. Usually, it occurs due to unwanted looping or wrong variable handling in the app service. It's the developer's mistake must be fixed immediately.
Implement a better App Performance Monitoring (APM) agent such as NewRelic. It helps you to find which MySQL queries causing the issue. The developers could have written a query with absolutely no brain, fix that.
It is how you can troubleshoot the slow performance issue between AWS EC2 and AWS RDS services. What I've explained above is common for all cloud service providers such as AWS, Google, Azure. From my experience, using managed database service like AWS RDS can dramatically reduce the performance of the MySQL InnoDB engine.
I would recommend you to run MySQL on bare AWS EC2 instance if you didn't get better performance after following above steps. It is the best option when operating at a high level of payload, like millions of queries per hour. It can also reduce your monthly AWS bill because managed services like AWS RDS are too costly.
We run Percona MySQL on bare AWS EC2 instance in SloopEngine production environment. SloopEngine is a cloud-based SaaS product which offers key features such as server-backed online IDE, project management, centralized SSH key management, server access control, SSH logging & auditing, live SSH auditing, activity tracking, live chat, and more for tech teams.
Hope it helps. Thank you.