Skip to content

RTMP server gets stuck if ever more than 1000 simultaneous connections #4339

Open
@darintay

Description

@darintay

Describe the bug
If there are ever 1000+ RTMP simultaneous connections, no future connections will ever be accepted (until restart).

Version
Tested with docker releases 5.0-r2, 5.0-r3 and 6.0-a2.

To Reproduce

  • Run srs with rtmp server.
  • Run: for x in {0..1000}; do timeout 5s nc localhost 1935 & done; wait;
  • Observe in logs 1000 lines of ...RTMP client ip=127.0.0.1:39708, fd=420 followed by 1000 lines of client disconnect peer. ret=1008
  • Try repeating the command above, or any RTMP connection; note that no more RTMP client logs show up at all, streams cannot be sent

Also note, if you use 999 instead of 1000, then it appears to work fine, you can run the loop as many times as you want and the server does not break.

Expected behavior
Even if the maximum connections are exceeded, I expect once they are disposed those slots will be usable and future connections will work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnglishNativeThis issue is conveyed exclusively in English.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions