AWS RDS MySQL some time get slow performance when update table1 set field='any word' where primarykey=1234 Normally when update table1 set field='any word' where primarykey=1234 take 1sec. or less but sometimes random take much more time possible 500sec. or more.

I was set very well and never see high CPU, or IOPS  

I use MySQL RDS 8.0.17 and workaround was down wait_time from 3600(default) to 200 to close sleep connections and then working better.
Finally was the auto commit as mustaccio told me in a comment:


  Looks like your "sleep connections" are not committing their transactions and thus keeping locks. Revise your application logic.