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-12-13 12:48:49 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
cbad7a30748343be8f83523646708a65c20436a1
cbad7a30
1 parent
5529813f
fix #257, server latency is 0.1s+, the bottleneck is encoder. 2.0.71
显示空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
29 行增加
和
18 行删除
README.md
trunk/src/app/srs_app_rtmp_conn.cpp
trunk/src/core/srs_core.hpp
README.md
查看文件 @
cbad7a3
...
...
@@ -786,6 +786,10 @@ The latency between encoder and player with realtime config(
</tr>
</table>
We use FMLE as encoder to benchmark. The latency of server is 0.1s+,
and the bottleneck is on the encoder. For more information, read
[
bug #257
](
https://github.com/winlinvip/simple-rtmp-server/issues/257#issuecomment-66864413
)
.
## Architecture
SRS always use the most simple architecture to support complex transaction.
...
...
trunk/src/app/srs_app_rtmp_conn.cpp
查看文件 @
cbad7a3
...
...
@@ -589,11 +589,12 @@ int SrsRtmpConn::do_playing(SrsSource* source, SrsQueueRecvThread* trd)
bool
user_specified_duration_to_stop
=
(
req
->
duration
>
0
);
int64_t
starttime
=
-
1
;
// setup the realtime.
realtime
=
_srs_config
->
get_realtime_enabled
(
req
->
vhost
);
// setup the mw config.
// when mw_sleep changed, resize the socket send buffer.
mw_enabled
=
true
;
change_mw_sleep
(
_srs_config
->
get_mw_sleep_ms
(
req
->
vhost
));
realtime
=
_srs_config
->
get_realtime_enabled
(
req
->
vhost
);
while
(
true
)
{
// to use isolate thread to recv, can improve about 33% performance.
...
...
@@ -642,34 +643,40 @@ int SrsRtmpConn::do_playing(SrsSource* source, SrsQueueRecvThread* trd)
return
ret
;
}
#ifdef SRS_PERF_QUEUE_COND_WAIT
// reportable
if
(
pithy_print
.
can_print
())
{
kbps
->
sample
();
srs_trace
(
"-> "
SRS_CONSTS_LOG_PLAY
" time=%"
PRId64
", msgs=%d, okbps=%d,%d,%d, ikbps=%d,%d,%d, mw=%d"
,
pithy_print
.
age
(),
count
,
kbps
->
get_send_kbps
(),
kbps
->
get_send_kbps_30s
(),
kbps
->
get_send_kbps_5m
(),
kbps
->
get_recv_kbps
(),
kbps
->
get_recv_kbps_30s
(),
kbps
->
get_recv_kbps_5m
(),
mw_sleep
);
}
// we use wait timeout to get messages,
// for min latency event no message incoming,
// so the count maybe zero.
srs_info
(
"mw wait %dms and got %d msgs %d(%"
PRId64
"-%"
PRId64
")ms"
,
if
(
count
>
0
)
{
srs_verbose
(
"mw wait %dms and got %d msgs %d(%"
PRId64
"-%"
PRId64
")ms"
,
mw_sleep
,
count
,
(
count
>
0
?
msgs
.
msgs
[
count
-
1
]
->
timestamp
-
msgs
.
msgs
[
0
]
->
timestamp
:
0
),
(
count
>
0
?
msgs
.
msgs
[
0
]
->
timestamp
:
0
),
(
count
>
0
?
msgs
.
msgs
[
count
-
1
]
->
timestamp
:
0
));
#else
}
if
(
count
<=
0
)
{
#ifndef SRS_PERF_QUEUE_COND_WAIT
srs_info
(
"mw sleep %dms for no msg"
,
mw_sleep
);
st_usleep
(
mw_sleep
*
1000
);
}
#else
srs_verbose
(
"mw wait %dms and got nothing."
,
mw_sleep
);
#endif
srs_info
(
"got %d msgs, min=%d, mw=%d"
,
count
,
SRS_PERF_MW_MIN_MSGS
,
mw_sleep
);
// reportable
if
(
pithy_print
.
can_print
())
{
kbps
->
sample
();
srs_trace
(
"-> "
SRS_CONSTS_LOG_PLAY
" time=%"
PRId64
", msgs=%d, okbps=%d,%d,%d, ikbps=%d,%d,%d, mw=%d"
,
pithy_print
.
age
(),
count
,
kbps
->
get_send_kbps
(),
kbps
->
get_send_kbps_30s
(),
kbps
->
get_send_kbps_5m
(),
kbps
->
get_recv_kbps
(),
kbps
->
get_recv_kbps_30s
(),
kbps
->
get_recv_kbps_5m
(),
mw_sleep
);
// ignore when nothing got.
continue
;
}
srs_info
(
"got %d msgs, min=%d, mw=%d"
,
count
,
SRS_PERF_MW_MIN_MSGS
,
mw_sleep
);
// only when user specifies the duration,
// we start to collect the durations for each message.
...
...
trunk/src/core/srs_core.hpp
查看文件 @
cbad7a3
...
...
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR 2
#define VERSION_MINOR 0
#define VERSION_REVISION 7
0
#define VERSION_REVISION 7
1
// server info.
#define RTMP_SIG_SRS_KEY "SRS"
#define RTMP_SIG_SRS_ROLE "origin/edge server"
...
...
请
注册
或
登录
后发表评论