Skip to content

Commit 2cd92e3

Browse files
authored
docs(kitex): document why WithMuxConnection/WithMuxTransport are deprecated (#1529)
1 parent df16769 commit 2cd92e3

8 files changed

Lines changed: 36 additions & 0 deletions

File tree

content/en/docs/kitex/FAQ/_index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ description: "Kitex Frequently Asked Questions and corresponding Answers."
2323

2424
**Q3: How to configure multiplexing?**
2525

26+
> **⚠️ Deprecated**
27+
>
28+
> Reason see [Connection Multiplexing](/docs/kitex/tutorials/basic-feature/connection_type/#connection-multiplexing).
29+
2630
- If you are using Thrift or Kitex Protobuf, to configure multiplexing:
2731
1. Configure WithMuxTransport() on your server.
2832
2. Configure WithMuxConnection(1) on your client

content/en/docs/kitex/Tutorials/basic-feature/connection_type.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ The setting of parameters is suggested as follows:
8181

8282
## Connection Multiplexing
8383

84+
> **⚠️ Deprecated**
85+
>
86+
> - `WithMuxConnection` and `WithMuxTransport` rely on [`netpollmux`](https://github.com/cloudwego/kitex/pull/1933) which is no longer maintained
87+
> - The performance gain is not significant in actual business scenarios
88+
> - The server must enable this feature first, otherwise, it may lead to request failure if used improperly
89+
8490
The client invokes the Server only need one connection normally when enabling Connection Multiplexing. Connection Multiplexing not only reduces the number of connections but also performs better than Connection Pool.
8591

8692
Special Note:

content/en/docs/kitex/Tutorials/options/client_options.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ Enable long connections. [More](/docs/kitex/tutorials/basic-feature/connection_t
6161

6262
### WithMuxConnection
6363

64+
> **⚠️ Deprecated**
65+
>
66+
> Reason see [Connection Multiplexing](/docs/kitex/tutorials/basic-feature/connection_type/#connection-multiplexing).
67+
6468
```go
6569
func WithMuxConnection(connNum int) Option
6670
```

content/en/docs/kitex/Tutorials/options/server_options.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ When local server has multiple IP addresses, you can also use this method to spe
4242

4343
### WithMuxTransport
4444

45+
> **⚠️ Deprecated**
46+
>
47+
> Reason see [Connection Multiplexing](/docs/kitex/tutorials/basic-feature/connection_type/#connection-multiplexing).
48+
4549
```go
4650
func WithMuxTransport() Option
4751
```

content/zh/docs/kitex/FAQ/_index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ description: "Kitex 常见问题解答。"
2222

2323
**Q3: 如何配置开启连接多路复用?**
2424

25+
> **⚠️ 已废弃**
26+
>
27+
> 原因详见[连接类型-连接多路复用](/zh/docs/kitex/tutorials/basic-feature/connection_type/#连接多路复用)
28+
2529
- 如果使用 Thrift 或 Kitex Protobuf ,开启连接多路复用:服务端配置 WithMuxTransport(),调用端配置 WithMuxConnection(1)。
2630
- 如果使用 gRPC, 默认是连接多路复用。
2731

content/zh/docs/kitex/Tutorials/basic-feature/connection_type.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ xxxCli := xxxservice.NewClient("destServiceName", client.WithLongConnection(conn
8282

8383
## 连接多路复用
8484

85+
> **⚠️ 已废弃**
86+
>
87+
> - `WithMuxConnection``WithMuxTransport` 所依赖的 [`netpollmux`](https://github.com/cloudwego/kitex/pull/1933) 不再维护
88+
> - 在实际业务场景中性能收益不显著
89+
> - 服务端需要先启用此功能,否则使用不当可能导致请求失败
90+
8591
开启连接多路复用,Client 访问 Server 常规只需要**1个连接**即可,相比连接池极限测试吞吐表现更好(目前的极限测试配置了2个连接),且能大大减少连接数量。
8692

8793
特别说明:

content/zh/docs/kitex/Tutorials/options/client_options.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ func WithLongConnection(cfg connpool.IdleConfig) Option
6060

6161
### 多路复用 - WithMuxConnection
6262

63+
> **⚠️ 已废弃**
64+
>
65+
> 原因详见[连接类型-连接多路复用](/zh/docs/kitex/tutorials/basic-feature/connection_type/#连接多路复用)。
66+
6367
```go
6468
func WithMuxConnection(connNum int) Option
6569
```

content/zh/docs/kitex/Tutorials/options/server_options.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ func WithServiceAddr(addr net.Addr) Option
4141

4242
### 多路复用 - WithMuxTransport
4343

44+
> **⚠️ 已废弃**
45+
>
46+
> 原因详见[连接类型-连接多路复用](/zh/docs/kitex/tutorials/basic-feature/connection_type/#连接多路复用)。
47+
4448
```go
4549
func WithMuxTransport() Option
4650
```

0 commit comments

Comments
 (0)