Mysql – the difference between threads connected and threads running

MySQLmysql-workbenchperformance

I am trying to understand the dashboard in mysql workbench and I saw this chart on bottom left.

threads connected: 149
threads running: 13

This was under a load and threads running increased as I put even more load on the server but it never went high. Is that normal? If threads connected is helping with parallel processing during loads, should it be higher?

Best Answer

Threads connected means the total number of client processes (threads) connected to the database server. This includes the count for threads running.

Thread running means the total number of client processes (threads) currently executing on the database server. The server is holding these connections while the client is waiting for a reply. These thread may be consuming IO/CPU, while others may do nothing while waiting for a table lock to be released. When the database is finished executing the thread, the client gets a reply, and the thread is changed from status "running" to "connected".