Stoping some threads or queries that may appear in the deadlock queue or locked from the InnoDB engine on AWS RDS is a different thing than self-hosted MySQL or MariaDB. They can potentially increase the database CPU load and cause a lot of problems. If you spot that some transactions are being stuck and they are reaching the max execution time, then you may need to kill the thread or the query itself.
Step 1. To get a useful information about the DB status, run:
show engine innodb status;
Step 2. To kill some stuck threads on AWS RDS, run:
Step 3. Killing some of the queries on AWS RDS can be done with:
Feel free to leave a comment below and if you find this tutorial useful, follow our official channel on Telegram.