Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SRT: Performance is low caused by srs_assert #3487

Open
winlinvip opened this issue Mar 27, 2023 · 1 comment
Open

SRT: Performance is low caused by srs_assert #3487

winlinvip opened this issue Mar 27, 2023 · 1 comment
Assignees
Labels
EnglishNative This issue is conveyed exclusively in English. Enhancement Improvement or enhancement. SRT It's about SRT protocol.

Comments

@winlinvip
Copy link
Member

winlinvip commented Mar 27, 2023

Note: Please read FAQ before file an issue, see #2716

Description

Please description your issue here

  1. SRS Version: 6.0.38

  2. SRS Config: conf/srt.conf

Replay

Please describe how to replay the bug?

Step 1: Start SRS

./objs/srs -c conf/srt.conf 

Step 2: Publish by FFmpeg

ffmpeg -stream_loop -1 -re -i bbb.h264.mp4 -c copy -pes_payload_size 0 -f mpegts 'srt://localhost:10080?streamid=#!::r=live/livestream,m=publish'

Note: The bitrate must be large enough, 30Mbps+

Step 3: top

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                                                                                     
 173532 winlin    20   0   20.0t 403352  10844 S  52.0  10.1   0:10.91 ./objs/srs -c console.conf

sudo perf top -p $(pidof srs)

Samples: 5K of event 'cpu-clock:pppH', 4000 Hz, Event count (approx.): 1269558516 lost: 0/0 drop: 0/0
Overhead  Shared Object        Symbol
  32.08%  srs                  [.] SrsCplxError::srs_assert
  12.97%  srs                  [.] SrsBuffer::skip
   5.81%  srs                  [.] SrsBuffer::empty
   5.27%  srs                  [.] srs_avc_startswith_annexb
   3.86%  srs                  [.] SrsBuffer::require
   2.56%  [kernel]             [k] finish_task_switch
   2.21%  srs                  [.] SrsBuffer::data
   2.12%  srs                  [.] SrsBuffer::pos

Expect

If disable the SRT to RTMP, CPU usage is low, about 5%.

@winlinvip winlinvip added Enhancement Improvement or enhancement. SRT It's about SRT protocol. labels Mar 27, 2023
@winlinvip winlinvip added the EnglishNative This issue is conveyed exclusively in English. label Jul 29, 2023
@winlinvip winlinvip changed the title SRT: Performance is low for 30Mbps video stream. SRT: Performance is low caused by lots of error objects Apr 7, 2024
@winlinvip winlinvip changed the title SRT: Performance is low caused by lots of error objects SRT: Performance is low caused by srs_assert Apr 7, 2024
@winlinvip winlinvip assigned winlinvip and unassigned xiaozhihong Apr 10, 2024
@winlinvip
Copy link
Member Author

When we finish the refactor of SRT server structure for #3251, we will start this performance improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EnglishNative This issue is conveyed exclusively in English. Enhancement Improvement or enhancement. SRT It's about SRT protocol.
Projects
None yet
Development

No branches or pull requests

2 participants