sandip ray
sandip ray

Reputation: 57

MySQL Client Connection

I have a very basic question regarding MySQL Workbench Client Connections window.In that window a Command column and a Time column is shown.If the Command column value is Sleep and the Time column value is very large(say 1500), does that mean that the client connection object has not been used for quite sometime? Also what are the meanings of "Threads Connected", "Threads Running","Total Connections" etc?

Upvotes: 2

Views: 3366

Answers (1)

Madhur Bhaiya
Madhur Bhaiya

Reputation: 28834

A sample MySQL Workbench screenshot of Client Connections real time is shown below:

enter image description here

It basically utilizes output of SHOW PROCESSLIST command.

  • Command Column: It basically implies the type of action happening in a particular connected thread. In the example screenshot: Sleep means that a thread is connected, but not firing any query as of now. Query means that a query is being executed. That is why we have more Threads Connected, but less number of Threads Running (Query command being run). Some threads are in the process of Connecting. Check more details here.
  • Time Column: The time in seconds that the thread has been in its current state.
  • Threads Connected: Number of MySQL client connections open to the server at the moment. So, for example, in our application code, when we do a mysqli_connect, it opens a connection to the Server. In this particular case, it also basically implies that 15 client sessions (most of them originating from application code) are executing simultaneously right now.
  • Threads Running: Out of these 15 connections, 4 are actually in the process of executing a query.
  • Total Connection: Total connections made to the server till date (since last server restart I believe).
  • Connection Limit: Maximum number of connections that can be made simultaneously. Default value of this is 151. In our case, we have increased it to 512, due to server capacity available.

Upvotes: 3

Related Questions