Skip to content

Commit f11f2b2

Browse files
committed
2.19.08.01 添加 mtls-kill-all-connections 命令的文档
1 parent a58033f commit f11f2b2

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

README.md

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ homepage:**http://www.sqlpy.com**
2020
- [温和删除表中的行 -- mtls-delete-rows](#温和删除表中的行)
2121
- [温和文件截断 -- mtls-file-truncate](#温和文件截断)
2222
- [数据库性能测试 -- mtls-perf-bench](#数据库性能测试)
23+
- [断开所有的客户端连接 -- mtls-kill-all-connections](#断开所有的客户端连接)
2324
---
2425

2526
## 关于
@@ -38,7 +39,8 @@ homepage:**http://www.sqlpy.com**
3839
|mtls-big-files| 查询出给定目录下的大文件名|
3940
|mtls-http| tcp(http)端口连通性测试|
4041
|mtls-log | 慢查询日志切片|
41-
|mtls-perfbench| 数据库跑分工具(开发中)|
42+
|mtls-perf-bench| 数据库跑分工具(开发中)|
43+
|mtls-kill-all-connections | 杀死所有的客户端连接|
4244

4345
---
4446

@@ -714,9 +716,35 @@ homepage:**http://www.sqlpy.com**
714716

715717
0、mtls-perf-bench 支持灵活的指定表的列数与类型
716718

717-
1、mtls-perf-bench 支持单线程和我线程两种工作模式
719+
1、mtls-perf-bench 支持单进程和多进程两种工作模式
720+
721+
---
722+
723+
## 断开所有的客户端连接
724+
**有些时候出于一些特殊的原因,我们想把所有的客户端连接都 kill**
718725

719-
a、由于 GIL 锁的存在所以 python 并没有真正的多线程,总的来讲 mtls-perf-bench 是一个IO密集型的程序,再加上我们一次只压一张表,所以整体上还是可以接受的。2.19.07.30 版本之后已经是多进程模型了。
726+
**1、** kill 之前
727+
```sql
728+
show processlist;
729+
+----+-----------------+-----------+------+---------+------+------------------------+------------------+
730+
| Id | User | Host | db | Command | Time | State | Info |
731+
+----+-----------------+-----------+------+---------+------+------------------------+------------------+
732+
| 4 | event_scheduler | localhost | NULL | Daemon | 229 | Waiting on empty queue | NULL |
733+
| 13 | root | localhost | NULL | Query | 0 | starting | show processlist |
734+
| 14 | root | localhost | NULL | Sleep | 10 | | NULL |
735+
+----+-----------------+-----------+------+---------+------+------------------------+------------------+
736+
3 rows in set (0.01 sec)
737+
```
738+
---
739+
740+
**2、** 发起 kill 指令
741+
```bash
742+
mtls-kill-all-conections --host=127.0.0.1 --user=root --port=3306 --password='xxxxx'
743+
744+
2019-08-07 15:30:21,353 INFO kill 13;
745+
2019-08-07 15:30:21,354 INFO kill 14;
746+
```
747+
>mtls-kill-all-conections 对 event、Dump 纯种是开了白名单的,所以他们不会被 kill 掉。
720748

721749
---
722750

@@ -727,3 +755,4 @@ homepage:**http://www.sqlpy.com**
727755

728756

729757

758+

0 commit comments

Comments
 (0)