I am using MySQL server 5.6.23 on CentOS and server configuration is like
RAM - 32 GB Cores - 6 cores Innodb buffer pool size = 8 GB Key cache size = 2 GB
We are using only select queries. But all select queries are getting locked and we are observing "Waiting for table metadata lock".
We have enabled slow query log and we observed the queries are getting locked and taking around more than 30 mins for execution. But when we try to execute the same query, it is getting executed in less than 3 secs.
As these queries are getting locked one by one, during the time, around 200 connections are showing same message as "Waiting for table metadata lock".
I had observed the Show engine innodb status output, in the the output also it is showing all the transactions locked.
But I did not used any CREATE/ALTER/INSERT/UPDATE/DELETE statements.