Does large amout of idle connections hurt performance of Mysql
Not much.
Why are there thousands?  Hundreds is reasonable.
Each connection takes some amount of RAM; if there are too many connections, you could run out of RAM, which would be bad for performance.
Also, if more than a few dozen connections suddenly get busy, they would be contending with each other for CPU, RAM, I/O, etc.
There is a &quot;wait_timeout&quot; that will disconnect a connection if it is idle for too long.