website performing slow once mysql connection RDS reached 50
There may be many causes here are some suggestions:

1) Check slow query log in mysql:

https://www.a2hosting.com/kb/developer-corner/mysql/enabling-the-slow-query-log-in-mysql

2) Change mysql driver in your application

Even if you downgrade it, you can have better results. Change a major version if possible.

3) Look for locks

mysqladmin debug 

It will dump a lot of information, including locks, but  you can get lock information by queries too:

https://dev.mysql.com/doc/refman/5.7/en/show-open-tables.html

Hope it helps