Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
镜像
OpenAtomFoundation
pika
提交
184593c1
pika
项目概览
镜像
/
OpenAtomFoundation
/
pika
11 个月 前同步成功
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
pika
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
184593c1
编写于
3月 06, 2017
作者:
Z
zhaoanan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add worker queue limit to pika and pink
上级
5429dc6c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
31 addition
and
11 deletion
+31
-11
include/pika_dispatch_thread.h
include/pika_dispatch_thread.h
+8
-3
src/pika_dispatch_thread.cc
src/pika_dispatch_thread.cc
+18
-6
src/pika_server.cc
src/pika_server.cc
+4
-1
third/pink
third/pink
+1
-1
未找到文件。
include/pika_dispatch_thread.h
浏览文件 @
184593c1
...
...
@@ -13,9 +13,14 @@
class
PikaDispatchThread
:
public
pink
::
DispatchThread
<
PikaClientConn
>
{
public:
PikaDispatchThread
(
int
port
,
int
work_num
,
PikaWorkerThread
**
pika_worker_thread
,
int
cron_interval
);
PikaDispatchThread
(
std
::
string
&
ip
,
int
port
,
int
work_num
,
PikaWorkerThread
**
pika_worker_thread
,
int
cron_interval
);
PikaDispatchThread
(
std
::
set
<
std
::
string
>
&
ips
,
int
port
,
int
work_num
,
PikaWorkerThread
**
pika_worker_thread
,
int
cron_interval
);
PikaDispatchThread
(
int
port
,
int
work_num
,
PikaWorkerThread
**
pika_worker_thread
,
int
cron_interval
,
int
queue_limit
);
PikaDispatchThread
(
std
::
string
&
ip
,
int
port
,
int
work_num
,
PikaWorkerThread
**
pika_worker_thread
,
int
cron_interval
,
int
queue_limit
);
PikaDispatchThread
(
std
::
set
<
std
::
string
>
&
ips
,
int
port
,
int
work_num
,
PikaWorkerThread
**
pika_worker_thread
,
int
cron_interval
,
int
queue_limit
);
virtual
~
PikaDispatchThread
();
virtual
bool
AccessHandle
(
std
::
string
&
ip
);
...
...
src/pika_dispatch_thread.cc
浏览文件 @
184593c1
...
...
@@ -12,16 +12,28 @@
extern
PikaServer
*
g_pika_server
;
extern
PikaConf
*
g_pika_conf
;
PikaDispatchThread
::
PikaDispatchThread
(
int
port
,
int
work_num
,
PikaWorkerThread
**
pika_worker_thread
,
int
cron_interval
)
:
DispatchThread
::
DispatchThread
(
port
,
work_num
,
reinterpret_cast
<
pink
::
WorkerThread
<
PikaClientConn
>**>
(
pika_worker_thread
),
cron_interval
)
{
PikaDispatchThread
::
PikaDispatchThread
(
int
port
,
int
work_num
,
PikaWorkerThread
**
pika_worker_thread
,
int
cron_interval
,
int
queue_limit
)
:
DispatchThread
::
DispatchThread
(
port
,
work_num
,
reinterpret_cast
<
pink
::
WorkerThread
<
PikaClientConn
>**>
(
pika_worker_thread
),
cron_interval
,
queue_limit
)
{
}
PikaDispatchThread
::
PikaDispatchThread
(
std
::
string
&
ip
,
int
port
,
int
work_num
,
PikaWorkerThread
**
pika_worker_thread
,
int
cron_interval
)
:
DispatchThread
::
DispatchThread
(
ip
,
port
,
work_num
,
reinterpret_cast
<
pink
::
WorkerThread
<
PikaClientConn
>**>
(
pika_worker_thread
),
cron_interval
)
{
PikaDispatchThread
::
PikaDispatchThread
(
std
::
string
&
ip
,
int
port
,
int
work_num
,
PikaWorkerThread
**
pika_worker_thread
,
int
cron_interval
,
int
queue_limit
)
:
DispatchThread
::
DispatchThread
(
ip
,
port
,
work_num
,
reinterpret_cast
<
pink
::
WorkerThread
<
PikaClientConn
>**>
(
pika_worker_thread
),
cron_interval
,
queue_limit
)
{
}
PikaDispatchThread
::
PikaDispatchThread
(
std
::
set
<
std
::
string
>
&
ips
,
int
port
,
int
work_num
,
PikaWorkerThread
**
pika_worker_thread
,
int
cron_interval
)
:
DispatchThread
::
DispatchThread
(
ips
,
port
,
work_num
,
reinterpret_cast
<
pink
::
WorkerThread
<
PikaClientConn
>**>
(
pika_worker_thread
),
cron_interval
)
{
PikaDispatchThread
::
PikaDispatchThread
(
std
::
set
<
std
::
string
>
&
ips
,
int
port
,
int
work_num
,
PikaWorkerThread
**
pika_worker_thread
,
int
cron_interval
,
int
queue_limit
)
:
DispatchThread
::
DispatchThread
(
ips
,
port
,
work_num
,
reinterpret_cast
<
pink
::
WorkerThread
<
PikaClientConn
>**>
(
pika_worker_thread
),
cron_interval
,
queue_limit
)
{
}
PikaDispatchThread
::~
PikaDispatchThread
()
{
...
...
src/pika_server.cc
浏览文件 @
184593c1
...
...
@@ -79,7 +79,10 @@ PikaServer::PikaServer() :
ips
.
insert
(
"127.0.0.1"
);
ips
.
insert
(
host_
);
}
pika_dispatch_thread_
=
new
PikaDispatchThread
(
ips
,
port_
,
worker_num_
,
pika_worker_thread_
,
3000
);
// We estimate the queue size
int
worker_queue_limit
=
g_pika_conf
->
maxclients
()
/
worker_num_
+
100
;
LOG
(
INFO
)
<<
"Worker queue limit is "
<<
worker_queue_limit
;
pika_dispatch_thread_
=
new
PikaDispatchThread
(
ips
,
port_
,
worker_num_
,
pika_worker_thread_
,
3000
,
worker_queue_limit
);
pika_binlog_receiver_thread_
=
new
PikaBinlogReceiverThread
(
ips
,
port_
+
1000
,
1000
);
pika_heartbeat_thread_
=
new
PikaHeartbeatThread
(
ips
,
port_
+
2000
,
1000
);
pika_trysync_thread_
=
new
PikaTrysyncThread
();
...
...
pink
@
074182af
比较
d79006e1
...
074182af
Subproject commit
d79006e16d4a8c09990dad1f2b0105f7909d95e3
Subproject commit
074182af2cb90fa5726f9e6de1a6f6d29f2c7a3f
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录