Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
b63bff4c
提交
b63bff4c
authored
4月 15, 2011
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
a few optimizations
上级
e4eade33
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
26 行增加
和
1 行删除
+26
-1
switch_core_sqldb.c
src/switch_core_sqldb.c
+2
-0
switch_event.c
src/switch_event.c
+24
-1
没有找到文件。
src/switch_core_sqldb.c
浏览文件 @
b63bff4c
...
@@ -201,9 +201,11 @@ SWITCH_DECLARE(switch_status_t) _switch_core_db_handle(switch_cache_db_handle_t
...
@@ -201,9 +201,11 @@ SWITCH_DECLARE(switch_status_t) _switch_core_db_handle(switch_cache_db_handle_t
r
=
_switch_cache_db_get_db_handle
(
dbh
,
SCDB_TYPE_CORE_DB
,
&
options
,
file
,
func
,
line
);
r
=
_switch_cache_db_get_db_handle
(
dbh
,
SCDB_TYPE_CORE_DB
,
&
options
,
file
,
func
,
line
);
}
}
/* I *think* we can do without this now, if not let me know
if (r == SWITCH_STATUS_SUCCESS && !(*dbh)->io_mutex) {
if (r == SWITCH_STATUS_SUCCESS && !(*dbh)->io_mutex) {
(*dbh)->io_mutex = sql_manager.io_mutex;
(*dbh)->io_mutex = sql_manager.io_mutex;
}
}
*/
return
r
;
return
r
;
}
}
...
...
src/switch_event.c
浏览文件 @
b63bff4c
...
@@ -291,6 +291,7 @@ static void *SWITCH_THREAD_FUNC switch_event_thread(switch_thread_t *thread, voi
...
@@ -291,6 +291,7 @@ static void *SWITCH_THREAD_FUNC switch_event_thread(switch_thread_t *thread, voi
switch_queue_t
*
queue
=
(
switch_queue_t
*
)
obj
;
switch_queue_t
*
queue
=
(
switch_queue_t
*
)
obj
;
uint32_t
index
=
0
;
uint32_t
index
=
0
;
int
my_id
=
0
;
int
my_id
=
0
;
int
auto_pause
=
0
;
switch_mutex_lock
(
EVENT_QUEUE_MUTEX
);
switch_mutex_lock
(
EVENT_QUEUE_MUTEX
);
THREAD_COUNT
++
;
THREAD_COUNT
++
;
...
@@ -307,6 +308,14 @@ static void *SWITCH_THREAD_FUNC switch_event_thread(switch_thread_t *thread, voi
...
@@ -307,6 +308,14 @@ static void *SWITCH_THREAD_FUNC switch_event_thread(switch_thread_t *thread, voi
switch_event_t
*
event
=
NULL
;
switch_event_t
*
event
=
NULL
;
int
loops
=
0
;
int
loops
=
0
;
if
(
auto_pause
)
{
if
(
!--
auto_pause
)
{
switch_core_session_ctl
(
SCSC_PAUSE_INBOUND
,
&
auto_pause
);
}
else
{
switch_cond_next
();
}
}
if
(
switch_queue_pop
(
queue
,
&
pop
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_queue_pop
(
queue
,
&
pop
)
!=
SWITCH_STATUS_SUCCESS
)
{
break
;
break
;
}
}
...
@@ -323,8 +332,22 @@ static void *SWITCH_THREAD_FUNC switch_event_thread(switch_thread_t *thread, voi
...
@@ -323,8 +332,22 @@ static void *SWITCH_THREAD_FUNC switch_event_thread(switch_thread_t *thread, voi
while
(
event
)
{
while
(
event
)
{
if
(
++
loops
>
2
)
{
if
(
++
loops
>
2
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CRIT
,
"Event system overloading
\n
"
);
uint32_t
last_sps
=
0
,
sess_count
=
switch_core_session_count
();
if
(
auto_pause
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CRIT
,
"Event system *still* overloading.
\n
"
);
}
else
{
switch_core_session_ctl
(
SCSC_LAST_SPS
,
&
last_sps
);
last_sps
=
(
uint32_t
)
(
float
)
(
last_sps
*
0
.
75
f
);
sess_count
=
(
uint32_t
)
(
float
)
(
sess_count
*
0
.
75
f
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CRIT
,
"Event system overloading. Taking a 10 second break, Reducing max_sessions to %d %dsps
\n
"
,
sess_count
,
last_sps
);
switch_core_session_limit
(
sess_count
);
switch_core_session_ctl
(
SCSC_SPS
,
&
last_sps
);
auto_pause
=
10
;
switch_core_session_ctl
(
SCSC_PAUSE_INBOUND
,
&
auto_pause
);
}
switch_yield
(
1000000
);
switch_yield
(
1000000
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论