Skip to content

Commit d0da94e

Browse files
committed
change flow control
1 parent 39d4642 commit d0da94e

File tree

6 files changed

+120
-102
lines changed

6 files changed

+120
-102
lines changed

2.Function/2.001_manager_dble_information.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,16 @@ dble_information 提供了一系列表格来描述dble内部一些元数据,
526526
<td></td>
527527
<td>连接池的心跳周期</td>
528528
</tr>
529+
<tr>
530+
<td>flow_high_level</td>
531+
<td></td>
532+
<td>流量控制的连接高水位</td>
533+
</tr>
534+
<tr>
535+
<td>flow_low_level</td>
536+
<td></td>
537+
<td>流量控制的连接低水位</td>
538+
</tr>
529539
</tbody>
530540
</table>
531541
@@ -2582,6 +2592,56 @@ mysql> select * from sql_log_by_tx_digest_by_entry_by_user;
25822592
25832593
* 数据行:略
25842594
2595+
#### 2.0.1.31 dble_flow_contro
2596+
* 表名:dble_flow_contro
2597+
2598+
* 含义:查看所有连接的流量控制状态
2599+
2600+
* 字段:
2601+
2602+
<table>
2603+
<thead>
2604+
<tr>
2605+
<th>列名</th>
2606+
<th>主键</th>
2607+
<th>注释</th>
2608+
</tr>
2609+
</thead>
2610+
<tbody>
2611+
<tr>
2612+
<td>connection_type</td>
2613+
<td>true</td>
2614+
<td>连接的类型,固定为MySQLConnection/ServerConnection其中之一</td></td>
2615+
</tr>
2616+
<tr>
2617+
<td>connection_id</td>
2618+
<td>true</td>
2619+
<td>连接在dble中的ID信息,可以通过ID查找日志</td>
2620+
</tr>
2621+
<tr>
2622+
<td>connection_info</td>
2623+
<td>false</td>
2624+
<td>接详细信息,使用端口,IP地址,用户,MySQL中的连接ID等</td>
2625+
</tr>
2626+
<tr>
2627+
<td>writing_queue_bytes</td>
2628+
<td>false</td>
2629+
<td>当前连接的准备写出的队列里积压的字节数</td>
2630+
</tr>
2631+
<tr>
2632+
<td>reading_queue_bytes</td>
2633+
<td>false</td>
2634+
<td>当前连接的已经读区的队列里积压的字节数,前段连接不支持此功能,恒为null</td>
2635+
</tr>
2636+
<tr>
2637+
<td>flow_controlled</td>
2638+
<td>false</td>
2639+
<td>当前连接是否处于被流控的状态</td>
2640+
</tr>
2641+
</tbody>
2642+
</table>
2643+
2644+
* 数据行:略
25852645
25862646
25872647
### 2.0.2 支持INSERT/UPDATE/DELETE的语法&表格

2.Function/2.1_manager_cmd/2.1.20_flow_control.md

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,53 @@
33
#### 2.1.20.1 查询流量控制当前配置状态
44
```
55
mysql> flow_control @@show;
6-
+---------------------+--------------------+------------------+
7-
| FLOW_CONTROL_ENABLE | FLOW_CONTROL_START | FLOW_CONTROL_END |
8-
+---------------------+--------------------+------------------+
9-
| false | 4096 | 256 |
10-
+---------------------+--------------------+------------------+
6+
+-------------------+-------------------------+------------------------+
7+
| FLOW_CONTROL_TYPE | FLOW_CONTROL_HIGH_LEVEL | FLOW_CONTROL_LOW_LEVEL |
8+
+-------------------+-------------------------+------------------------+
9+
| FRONT_END | 4194304 | 262144 |
10+
| dbGroup1-hostM1 | 4194304 | 262144 |
11+
| dbGroup2-hostM2 | 4194304 | 262144 |
12+
+-------------------+-------------------------+------------------------+
1113
1 row in set (0.00 sec)
1214
```
1315
列描述:
14-
+ FLOW_CONTROL_ENABLE 是否有开启流量控制功能
15-
+ FLOW_CONTROL_START 流量控制功能触发值
16-
+ FLOW_CONTROL_END 流量控制功能取消值
16+
+ FLOW_CONTROL_TYPE 流量控制的类型,前端连接为固定值“FRONT_END”;后段连接为所在的实例名,格式为:组名-实例名
17+
+ FLOW_CONTROL_HIGH_LEVEL 流量控制的高水位线,积压队列的字节数到达此位置开始控制流量
18+
+ FLOW_CONTROL_LOW_LEVEL 流量控制高水位线,积压队列的字节数低于此位置不再控制流量
1719

1820
#### 2.1.20.2 修改流量控制当前配置状态
19-
flow_control @@set [enableFlowControl = true/false] [flowControlStart = ?] [flowControlEnd = ?]
21+
flow_control @@set [enableFlowControl = true/false] [flowControlHighLevel = ?] [flowControlLowLevel = ?]
2022
```
21-
MySQL [(none)]> flow_control @@set enableFlowControl = true flowControlStart= 100 flowControlEND = 30;
23+
MySQL [(none)]> flow_control @@set enableFlowControl = true flowControlHighLevel= 100000 flowControlLowLevel = 30000;
2224
Query OK, 0 rows affected (0.02 sec)
2325
```
24-
通过此命令可以修改对应内存中生效的值,不会影响配置文件,对应关系如下:
26+
通过此命令可以修改对应内存中生效的值,同时会变更文件`bootstrap.dynamic.cnf` 将其固化,对应关系如下:
2527
+ enableFlowControl: bootstrap.cnf中enableFlowControl参数
26-
+ flowControlStart:bootstrap.cnf中flowControlStartThreshold参数
27-
+ flowControlEnd:bootstrap.cnf中flowControlStopThreshold参数
28+
+ flowControlHighLevel:bootstrap.cnf中flowControlHighLevel参数
29+
+ flowControlLowLevel:bootstrap.cnf中flowControlLowLevel参数
2830

29-
注:以上命令三个参数顺序相关
30-
#### 2.1.20.3 查看当前流量控制中的连接
31+
注:以上命令三个参数顺序不可变更
32+
33+
#### 2.1.20.3 查看当前连接的流量控制状态
3134
```
3235
MySQL [(none)]> flow_control @@list;
33-
+------------------+---------------+------------------------------------+------------------+
34-
| CONNECTION_TYPE | CONNECTION_ID | CONNECTION_INFO | WRITE_QUEUE_SIZE |
35-
+------------------+---------------+------------------------------------+------------------+
36-
| ServerConnection | 2 | 127.0.0.1:60772/testdb user = root | 2920 |
37-
+------------------+---------------+------------------------------------+------------------+
36+
+------------------+---------------+---------------------------------------+---------------------+---------------------+-----------------+
37+
| CONNECTION_TYPE | CONNECTION_ID | CONNECTION_INFO | WRITING_QUEUE_BYTES | READING_QUEUE_BYTES | FLOW_CONTROLLED |
38+
+------------------+---------------+---------------------------------------+---------------------+---------------------+-----------------+
39+
| ServerConnection | 1 | 127.0.0.1:50817/schema1 user = root | 464594 | NULL | false |
40+
| MySQLConnection | 8 | 10.186.65.86:3307/db2 mysqlId = 1287 | 0 | 0 | false |
41+
| MySQLConnection | 12 | 10.186.65.86:3308/db1 mysqlId = 1557 | 0 | 0 | false |
42+
| MySQLConnection | 6 | 10.186.65.86:3307/db1 mysqlId = 1285 | 0 | 86172 | false |
43+
| MySQLConnection | 15 | 10.186.65.86:3308/db2 mysqlId = 1559 | 0 | 0 | false |
44+
+------------------+---------------+---------------------------------------+---------------------+---------------------+-----------------+
3845
3946
```
4047
列描述:
41-
+ CONNECTION_TYPE 连接的类型MySQLConnection/ServerConnection
48+
+ CONNECTION_TYPE 连接的类型,固定为MySQLConnection/ServerConnection其中之一
4249
+ CONNECTION_ID 连接在dble中的ID信息,可以通过ID查找日志
4350
+ CONNECTION_INFO 连接详细信息,使用端口,IP地址,用户,MySQL中的连接ID等
44-
+ WRITE_QUEUE_SIZE 当前连接的写队列长度
51+
+ WRITING_QUEUE_BYTES 当前连接的准备写出的队列里积压的字节数
52+
+ READING_QUEUE_BYTES 当前连接的已经读区的队列里积压的字节数,前段连接不支持此功能,恒为null
53+
+ FLOW_CONTROLLED 当前连接是否处于被流控的状态
54+
55+
如果需要过滤结果集,可以使用dble_information.dble_flow_control 来过滤

0 commit comments

Comments
 (0)