开发者

How can i check the duration of connection in mysql?

I believe Max_used_connections is the number of mysql connections are still open and are not closed开发者_如何学Go yet.

| Variable_name            | Value |
+--------------------------+-------+
| Innodb_row_lock_time_max | 0     |
| Max_used_connections     | 22    |
| Tc_log_max_pages_used    | 0     |
+--------------------------+-------+

Here i want to see the list of connections with the duration how long this connection is being used. And when this connection is going to be killed. (wait_timeout variable)

| Variable_name            | Value | Start Time | Aprox End Time | Hours (Use)
+--------------------------+-------+
| Innodb_row_lock_time_max | 0     |
| Max_used_connections     | 22    |
| Tc_log_max_pages_used    | 0     |
+--------------------------+-------+

I set wait_timeout and interactive_timeout to 2 and still 22 connections are open. I waited for 30 minuets, i see there is no change in the Max_used_connections variable.

Can anyone help me ?


You have to restart your server to see a change of that variable, because, as the manual says, it holds The maximum number of connections that have been in use simultaneously since the server started.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜