Skip to content

Commit 06c6f1f

Browse files
EmmyMiao87morningman-cmy
authored andcommitted
[Config]Remove max_user_connections from config (apache#3805)
Update max_user_connections by user property: ``` set property `user` max_user_connections=100; ```
1 parent bfa6e8f commit 06c6f1f

File tree

7 files changed

+141
-7
lines changed

7 files changed

+141
-7
lines changed

docs/.vuepress/sidebar/en.js

+1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ module.exports = [
9898
children: [
9999
"fe_config",
100100
"be_config",
101+
"user_property,
101102
],
102103
sidebarDepth: 1,
103104
},

docs/.vuepress/sidebar/zh-CN.js

+1
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ module.exports = [
107107
children: [
108108
"fe_config",
109109
"be_config",
110+
"user_property",
110111
],
111112
sidebarDepth: 1,
112113
},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
{
3+
"title": "User Property",
4+
"language": "en"
5+
}
6+
---
7+
8+
<!--
9+
Licensed to the Apache Software Foundation (ASF) under one
10+
or more contributor license agreements. See the NOTICE file
11+
distributed with this work for additional information
12+
regarding copyright ownership. The ASF licenses this file
13+
to you under the Apache License, Version 2.0 (the
14+
"License"); you may not use this file except in compliance
15+
with the License. You may obtain a copy of the License at
16+
17+
http://www.apache.org/licenses/LICENSE-2.0
18+
19+
Unless required by applicable law or agreed to in writing,
20+
software distributed under the License is distributed on an
21+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
22+
KIND, either express or implied. See the License for the
23+
specific language governing permissions and limitations
24+
under the License.
25+
-->
26+
27+
# User configuration item
28+
29+
This document mainly introduces related configuration items at the User level. The configuration of the User level is mainly effective for a single user. Each user can set their own User property. Does not affect each other.
30+
31+
## View configuration items
32+
33+
After the FE is started, on the MySQL client, use the following command to view the User configuration items:
34+
35+
`SHOW PROPERTY [FOR user] [LIKE key pattern]`
36+
37+
The specific syntax can be queried through the command: `help show property;`.
38+
39+
## Set configuration items
40+
41+
After FE is started, on the MySQL client, modify the User configuration items with the following command:
42+
43+
`SET PROPERTY [FOR'user'] 'key' = 'value' [,'key' ='value']`
44+
45+
The specific syntax can be queried through the command: `help set property;`.
46+
47+
User-level configuration items will only take effect for the specified users, and will not affect the configuration of other users.
48+
49+
## Application examples
50+
51+
1. Modify the max_user_connections of user Billie
52+
53+
Use `SHOW PROPERTY FOR 'Billie' LIKE '%max_user_connections%';` to check that the current maximum number of links for Billie users is 100.
54+
55+
Use `SET PROPERTY FOR 'Billie' 'max_user_connections' = '200';` to modify the current maximum number of connections for Billie users to 200.
56+
57+
## Configuration item list
58+
59+
### max_user_connections
60+
61+
The maximum number of user connections, the default value is 100 In general, this parameter does not need to be changed unless the number of concurrent queries exceeds the default value.
62+
63+
### resource
64+
65+
### quota
66+
67+
### default_load_cluster
68+
69+
### load_cluster

docs/zh-CN/administrator-guide/config/fe_config.md

-2
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,6 @@ FE 的配置项有两种方式进行配置:
371371
372372
### `max_connection_scheduler_threads_num`
373373
374-
### `max_conn_per_user`
375-
376374
### `max_create_table_timeout_second`
377375
378376
### `max_distribution_pruner_recursion_depth`
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
{
3+
"title": "用户配置项",
4+
"language": "zh-CN"
5+
}
6+
---
7+
8+
<!--
9+
Licensed to the Apache Software Foundation (ASF) under one
10+
or more contributor license agreements. See the NOTICE file
11+
distributed with this work for additional information
12+
regarding copyright ownership. The ASF licenses this file
13+
to you under the Apache License, Version 2.0 (the
14+
"License"); you may not use this file except in compliance
15+
with the License. You may obtain a copy of the License at
16+
17+
http://www.apache.org/licenses/LICENSE-2.0
18+
19+
Unless required by applicable law or agreed to in writing,
20+
software distributed under the License is distributed on an
21+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
22+
KIND, either express or implied. See the License for the
23+
specific language governing permissions and limitations
24+
under the License.
25+
-->
26+
27+
# User 配置项
28+
29+
该文档主要介绍了 User 级别的相关配置项。User 级别的配置生效范围为单个用户。每个用户都可以设置自己的 User property。相互不影响。
30+
31+
## 查看配置项
32+
33+
FE 启动后,在 MySQL 客户端,通过下面命令查看 User 的配置项:
34+
35+
`SHOW PROPERTY [FOR user] [LIKE key pattern]`
36+
37+
具体语法可通过命令:`help show property;` 查询。
38+
39+
## 设置配置项
40+
41+
FE 启动后,在MySQL 客户端,通过下面命令修改 User 的配置项:
42+
43+
`SET PROPERTY [FOR 'user'] 'key' = 'value' [, 'key' = 'value']`
44+
45+
具体语法可通过命令:`help set property;` 查询。
46+
47+
User 级别的配置项只会对指定用户生效,并不会影响其他用户的配置。
48+
49+
## 应用举例
50+
51+
1. 修改用户 Billie 的 `max_user_connections`
52+
53+
通过 `SHOW PROPERTY FOR 'Billie' LIKE '%max_user_connections%';` 查看 Billie 用户当前的最大链接数为 100。
54+
55+
通过 `SET PROPERTY FOR 'Billie' 'max_user_connections' = '200';` 修改 Billie 用户的当前最大连接数到 200。
56+
57+
## 配置项列表
58+
59+
### max_user_connections
60+
61+
用户最大的连接数,默认值为100。一般情况不需要更改该参数,除非查询的并发数超过了默认值。
62+
63+
### resource
64+
65+
### quota
66+
67+
### default_load_cluster
68+
69+
### load_cluster

fe/src/main/java/org/apache/doris/common/Config.java

-4
Original file line numberDiff line numberDiff line change
@@ -668,10 +668,6 @@ public class Config extends ConfigBase {
668668
* Maximal number of connections per FE.
669669
*/
670670
@ConfField public static int qe_max_connection = 1024;
671-
/*
672-
* Maximal number of connections per user, per FE.
673-
*/
674-
@ConfField public static int max_conn_per_user = 100;
675671

676672
/*
677673
* Maximal number of thread in connection-scheduler-pool.

fe/src/main/java/org/apache/doris/mysql/privilege/UserProperty.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public class UserProperty implements Writable {
7474

7575
private String qualifiedUser;
7676

77-
private long maxConn = Config.max_conn_per_user;
77+
private long maxConn = 100;
7878
// Resource belong to this user.
7979
private UserResource resource = new UserResource(1000);
8080
// load cluster

0 commit comments

Comments
 (0)