Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
winlin
2014-08-01 22:43:12 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
15d4993cc39e54f6d704bf4f7b0b5c68a449516c
15d4993c
1 parent
6539ce69
slowdown the cpu usage for srs to calc connections when too many connections. 0.9.180
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
12 行增加
和
4 行删除
trunk/3rdparty/gprof/readme.txt
trunk/src/app/srs_app_server.cpp
trunk/src/app/srs_app_utility.cpp
trunk/src/core/srs_core.hpp
trunk/3rdparty/gprof/readme.txt
查看文件 @
15d4993
...
...
@@ -14,7 +14,7 @@ gprof2dot.py:
0. 若需要图形化,编译dot:
cd 3rdparty/gprof && bash build_gprof2dot.sh
1. srs配置时:
./configure --with-
pg
./configure --with-
gprof
脚本会加入编译参数"-pg -lc_p",gcc -g -pg -lc_p -c xxx -o xxx.o,即在configure中打开 Performance="-pg -lc_p"
链接时,加入链接选项"-pg",否则无法工作:gcc -pg -o srs xxxx.o,即在configure中打开 PerformanceLink="-pg"
2. 编译和启动程序:make && ./objs/srs -c conf/srs.conf
...
...
trunk/src/app/srs_app_server.cpp
查看文件 @
15d4993
...
...
@@ -90,7 +90,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// update network devices info interval:
// SRS_SYS_CYCLE_INTERVAL * SRS_SYS_NETWORK_RTMP_SERVER_RESOLUTION_TIMES
#define SRS_SYS_NETWORK_RTMP_SERVER_RESOLUTION_TIMES
9
0
#define SRS_SYS_NETWORK_RTMP_SERVER_RESOLUTION_TIMES
12
0
SrsListener
::
SrsListener
(
SrsServer
*
server
,
SrsListenerType
type
)
{
...
...
trunk/src/app/srs_app_utility.cpp
查看文件 @
15d4993
...
...
@@ -833,10 +833,18 @@ void srs_update_rtmp_server(int nb_conn, SrsKbps* kbps)
int
nb_conn_sys_other
=
0
;
// @see: http://tester-higkoo.googlecode.com/svn-history/r14/trunk/Tools/iostat/iostat.c
while
(
fgets
(
buf
,
sizeof
(
buf
),
f
)
)
{
for
(
int
i
=
0
;
fgets
(
buf
,
sizeof
(
buf
),
f
);
i
++
)
{
int
st
=
0
;
int
ret
=
sscanf
(
buf
,
"%*s %*s %*s %2x
\n
"
,
&
st
);
// there are maybe many many connections,
// for example, when srs used for monitor other process,
// like nginx, there are maybe many TIME_WAIT conections.
// we sleep 1ms when read 1000 records, so 100ms for 10w connections.
if
((
i
%
1000
)
==
0
)
{
st_usleep
(
1000
);
}
if
(
ret
==
1
)
{
if
(
st
==
SYS_TCP_ESTABLISHED
)
{
nb_conn_sys_established
++
;
...
...
trunk/src/core/srs_core.hpp
查看文件 @
15d4993
...
...
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR "0"
#define VERSION_MINOR "9"
#define VERSION_REVISION "1
79
"
#define VERSION_REVISION "1
80
"
#define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
// server info.
#define RTMP_SIG_SRS_KEY "SRS"
...
...
请
注册
或
登录
后发表评论