Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Shardingsphere
提交
157ccc18
Shardingsphere
项目概览
apache
/
Shardingsphere
通知
56
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Shardingsphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
157ccc18
编写于
8月 06, 2018
作者:
T
tuohai666
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#1099, worker group and user group share the acceptor.size configuration
上级
b3971b6f
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
21 addition
and
4 deletion
+21
-4
sharding-core/src/main/java/io/shardingsphere/core/constant/ShardingPropertiesConstant.java
...rdingsphere/core/constant/ShardingPropertiesConstant.java
+11
-0
sharding-proxy/src/main/java/io/shardingsphere/proxy/config/RuleRegistry.java
...ain/java/io/shardingsphere/proxy/config/RuleRegistry.java
+3
-0
sharding-proxy/src/main/java/io/shardingsphere/proxy/frontend/ShardingProxy.java
.../java/io/shardingsphere/proxy/frontend/ShardingProxy.java
+4
-4
sharding-proxy/src/main/resources/conf/config.yaml
sharding-proxy/src/main/resources/conf/config.yaml
+1
-0
sharding-proxy/src/main/resources/conf/config_master_slave.yaml
...ng-proxy/src/main/resources/conf/config_master_slave.yaml
+1
-0
sharding-proxy/src/test/resources/conf/config.yaml
sharding-proxy/src/test/resources/conf/config.yaml
+1
-0
未找到文件。
sharding-core/src/main/java/io/shardingsphere/core/constant/ShardingPropertiesConstant.java
浏览文件 @
157ccc18
...
...
@@ -42,6 +42,17 @@ public enum ShardingPropertiesConstant {
*/
SQL_SHOW
(
"sql.show"
,
Boolean
.
FALSE
.
toString
(),
boolean
.
class
),
/**
* Worker group or user group thread max size.
*
* <p>
* Worker group accept tcp connection.
* User group accept MySQL command.
* Default: CPU cores * 2.
* </p>
*/
ACCEPTOR_SIZE
(
"acceptor.size"
,
String
.
valueOf
(
Runtime
.
getRuntime
().
availableProcessors
()
*
2
),
int
.
class
),
/**
* Worker thread max size.
*
...
...
sharding-proxy/src/main/java/io/shardingsphere/proxy/config/RuleRegistry.java
浏览文件 @
157ccc18
...
...
@@ -75,6 +75,8 @@ public final class RuleRegistry {
private
ConnectionMode
connectionMode
;
private
int
acceptorSize
;
private
int
executorSize
;
private
BackendNIOConfiguration
backendNIOConfig
;
...
...
@@ -108,6 +110,7 @@ public final class RuleRegistry {
connectionMode
=
ConnectionMode
.
valueOf
(
shardingProperties
.<
String
>
getValue
(
ShardingPropertiesConstant
.
CONNECTION_MODE
));
transactionType
=
TransactionType
.
valueOf
(
shardingProperties
.<
String
>
getValue
(
ShardingPropertiesConstant
.
PROXY_TRANSACTION_MODE
));
transactionManager
=
ProxyTransactionLoader
.
load
(
transactionType
);
acceptorSize
=
shardingProperties
.
getValue
(
ShardingPropertiesConstant
.
ACCEPTOR_SIZE
);
executorSize
=
shardingProperties
.
getValue
(
ShardingPropertiesConstant
.
EXECUTOR_SIZE
);
// TODO :jiaqi force off use NIO for backend, this feature is not complete yet
boolean
useNIO
=
false
;
...
...
sharding-proxy/src/main/java/io/shardingsphere/proxy/frontend/ShardingProxy.java
浏览文件 @
157ccc18
...
...
@@ -101,8 +101,8 @@ public final class ShardingProxy {
}
private
void
groupsEpoll
(
final
ServerBootstrap
bootstrap
)
{
workerGroup
=
new
EpollEventLoopGroup
(
RULE_REGISTRY
.
get
Execu
torSize
());
userGroupContext
.
setUserGroup
(
new
EpollEventLoopGroup
(
RULE_REGISTRY
.
get
Execu
torSize
()));
workerGroup
=
new
EpollEventLoopGroup
(
RULE_REGISTRY
.
get
Accep
torSize
());
userGroupContext
.
setUserGroup
(
new
EpollEventLoopGroup
(
RULE_REGISTRY
.
get
Accep
torSize
()));
bootstrap
.
group
(
bossGroup
,
workerGroup
)
.
channel
(
EpollServerSocketChannel
.
class
)
.
option
(
EpollChannelOption
.
SO_BACKLOG
,
128
)
...
...
@@ -114,8 +114,8 @@ public final class ShardingProxy {
}
private
void
groupsNio
(
final
ServerBootstrap
bootstrap
)
{
workerGroup
=
new
NioEventLoopGroup
(
RULE_REGISTRY
.
get
Execu
torSize
());
userGroupContext
.
setUserGroup
(
new
NioEventLoopGroup
(
RULE_REGISTRY
.
get
Execu
torSize
()));
workerGroup
=
new
NioEventLoopGroup
(
RULE_REGISTRY
.
get
Accep
torSize
());
userGroupContext
.
setUserGroup
(
new
NioEventLoopGroup
(
RULE_REGISTRY
.
get
Accep
torSize
()));
bootstrap
.
group
(
bossGroup
,
workerGroup
)
.
channel
(
NioServerSocketChannel
.
class
)
.
option
(
ChannelOption
.
SO_BACKLOG
,
128
)
...
...
sharding-proxy/src/main/resources/conf/config.yaml
浏览文件 @
157ccc18
...
...
@@ -61,6 +61,7 @@
# # CONNECTION_STRICTLY: Proxy will release connections after get the overall rows from the ResultSet.
# # Meanwhile, the cost of the memory will be increased.
# connection.mode: MEMORY_STRICTLY
# acceptor.size: 16 # The default value is available processors count * 2.
# executor.size: 16 # The default value is available processors count.
# sql.show: false
#
...
...
sharding-proxy/src/main/resources/conf/config_master_slave.yaml
浏览文件 @
157ccc18
...
...
@@ -40,6 +40,7 @@
# # CONNECTION_STRICTLY: Proxy will release connections after get the overall rows from the ResultSet.
# # Meanwhile, the cost of the memory will be increased.
# connection.mode: MEMORY_STRICTLY
# acceptor.size: 16 # The default value is available processors count * 2.
# executor.size: 16 # The default value is available processors count.
# sql.show: false
...
...
sharding-proxy/src/test/resources/conf/config.yaml
浏览文件 @
157ccc18
...
...
@@ -45,6 +45,7 @@ shardingRule:
props
:
connection.mode
:
MEMORY_STRICTLY
acceptor.size
:
16
executor.size
:
16
sql.show
:
false
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录