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
2015-03-04 16:52:43 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3e394a5f065f5086ad56dad4b71b27f522608d5d
3e394a5f
1 parent
04dc60eb
for #320, set socket send buffer to smaller macro. 2.0.131
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
39 行增加
和
1 行删除
trunk/src/app/srs_app_rtmp_conn.cpp
trunk/src/core/srs_core.hpp
trunk/src/core/srs_core_performance.hpp
trunk/src/main/srs_main_server.cpp
trunk/src/app/srs_app_rtmp_conn.cpp
查看文件 @
3e394a5
...
...
@@ -1110,6 +1110,11 @@ void SrsRtmpConn::change_mw_sleep(int sleep_ms)
// socket send buffer, system will double it.
int
nb_sbuf
=
socket_buffer_size
/
2
;
// override the send buffer by macro.
#ifdef SRS_PERF_SO_SNDBUF_SIZE
nb_sbuf
=
SRS_PERF_SO_SNDBUF_SIZE
/
2
;
#endif
// set the socket send buffer when required larger buffer
if
(
setsockopt
(
fd
,
SOL_SOCKET
,
SO_SNDBUF
,
&
nb_sbuf
,
sock_buf_size
)
<
0
)
{
srs_warn
(
"set sock SO_SENDBUF=%d failed."
,
nb_sbuf
);
...
...
trunk/src/core/srs_core.hpp
查看文件 @
3e394a5
...
...
@@ -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 13
0
#define VERSION_REVISION 13
1
// server info.
#define RTMP_SIG_SRS_KEY "SRS"
...
...
trunk/src/core/srs_core_performance.hpp
查看文件 @
3e394a5
...
...
@@ -169,6 +169,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
//#define SRS_PERF_TCP_NODELAY
#undef SRS_PERF_TCP_NODELAY
/**
* set the socket send buffer,
* to force the server to send smaller tcp packet.
* @see https://github.com/winlinvip/simple-rtmp-server/issues/320
* @remark undef it to auto calc it by merged write sleep ms.
* @remark only apply it when SRS_PERF_MW_SO_RCVBUF is defined.
*/
#ifdef SRS_PERF_MW_SO_SNDBUF
//#define SRS_PERF_SO_SNDBUF_SIZE 1024
#undef SRS_PERF_SO_SNDBUF_SIZE
#endif
#endif
...
...
trunk/src/main/srs_main_server.cpp
查看文件 @
3e394a5
...
...
@@ -148,6 +148,24 @@ void show_macro_features()
srs_trace
(
"MW(merged-write) default sleep %d"
,
SRS_PERF_MW_SLEEP
);
srs_trace
(
"read chunk stream cache cid [0, %d)"
,
SRS_PERF_CHUNK_STREAM_CACHE
);
srs_trace
(
"default gop cache %d, play queue %ds"
,
SRS_PERF_GOP_CACHE
,
SRS_PERF_PLAY_QUEUE
);
#ifndef SRS_PERF_COMPLEX_SEND
srs_warn
(
"complex send algorithm disabled."
);
#else
srs_trace
(
"complex send algorithm enabled."
);
#endif
#ifdef SRS_PERF_TCP_NODELAY
srs_warn
(
"TCP_NODELAY enabled, hurts performance."
);
#else
srs_trace
(
"TCP_NODELAY disabled."
);
#endif
#ifdef SRS_PERF_SO_SNDBUF_SIZE
srs_warn
(
"socket send buffer size %d"
,
SRS_PERF_SO_SNDBUF_SIZE
);
#else
srs_trace
(
"auto guess socket send buffer by merged write"
);
#endif
int
possible_mr_latency
=
0
;
#ifdef SRS_PERF_MERGED_READ
...
...
@@ -170,6 +188,10 @@ void check_macro_features()
#warning "using develop SRS, please use release instead."
srs_warn
(
"SRS %s is develop branch, please use %s instead"
,
RTMP_SIG_SRS_VERSION
,
RTMP_SIG_SRS_RELEASE
);
#endif
#if defined(SRS_PERF_SO_SNDBUF_SIZE) && !defined(SRS_PERF_MW_SO_SNDBUF)
#error "SRS_PERF_SO_SNDBUF_SIZE depends on SRS_PERF_MW_SO_SNDBUF"
#endif
}
/**
...
...
请
注册
或
登录
后发表评论