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-04 13:54:02 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
90992b31a3cd9621243a746251f8ab719c9b100e
90992b31
1 parent
60bc9c2a
for bug #194, add the send macro to performance.
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
15 行增加
和
2 行删除
trunk/src/app/srs_app_rtmp_conn.cpp
trunk/src/core/srs_core_performance.hpp
trunk/src/app/srs_app_rtmp_conn.cpp
查看文件 @
90992b3
...
...
@@ -49,6 +49,7 @@ using namespace std;
#include <srs_protocol_msg_array.hpp>
#include <srs_protocol_amf0.hpp>
#include <srs_app_recv_thread.hpp>
#include <srs_core_performance.hpp>
// when stream is busy, for example, streaming is already
// publishing, when a new client to request to publish,
...
...
@@ -591,7 +592,7 @@ int SrsRtmpConn::do_playing(SrsSource* source, SrsQueueRecvThread* trd)
// no message to send, sleep a while.
if
(
count
<=
0
)
{
srs_verbose
(
"sleep for no messages to send"
);
st_usleep
(
SRS_
CONSTS_RTMP_PULSE_TIMEOUT_US
);
st_usleep
(
SRS_
PERF_SEND_MSGS_CACHE
*
1000
);
}
// reportable
...
...
trunk/src/core/srs_core_performance.hpp
查看文件 @
90992b3
...
...
@@ -64,8 +64,20 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* buffer=65536B, small=4096B, sleep=780ms
* that is, when got nread bytes smaller than 4KB, sleep(780ms).
*/
#define SRS_PERF_MERGED_READ
#undef SRS_PERF_MERGED_READ
#define SRS_PERF_MERGED_READ
/**
* the send cache time in ms.
* to improve send performance, cache msgs and send in a time.
* for example, cache 500ms videos and audios, then convert all these
* msgs to iovecs, finally use writev to send.
* @remark this largely improve performance, from 3.5k+ to 7.5k+.
* the latency+ when cache+.
* @remark the socket send buffer default to 185KB, it large enough.
* @see https://github.com/winlinvip/simple-rtmp-server/issues/194
*/
#define SRS_PERF_SEND_MSGS_CACHE 500
#endif
...
...
请
注册
或
登录
后发表评论