High Sleep value on Mysql

Hi,

We have many queries / connections to the database left open, some are open for 668 seconds and being idle/sleep. Anyone know how we can tweaked the rails code and control to close connection ?

Thank you.