#1033073 libnginx-mod-rtmp: clients hang trying to play published streams due to Debian default nginx configuration

Package:
libnginx-mod-rtmp
Source:
libnginx-mod-rtmp
Description:
RTMP support for Nginx
Submitter:
Mark Nipper
Date:
2023-03-16 23:15:04 UTC
Severity:
normal
#1033073#5
Date:
2023-03-16 17:12:32 UTC
From:
To:
	I've already opened an issue for this upstream at:
---
https://github.com/arut/nginx-rtmp-module/issues/1719

But to summarize my findings here, the Debian stock nginx
configuration uses:
---
worker_processes auto;

which seems to break things a bit for this module.  The default
value for that setting upstream is 1.  If I use 1 instead of
auto, then everything works fine.  If I leave it as auto or any
number other than 1, then I run into the issue where clients
trying to play a currently published stream hang indefinitely
after successfully opening the TCP connection to this RTMP module
on 1935.  Setting that option to 1 can massively decrease
performance though on massively multicore systems of today.

	Thanks to the Open Streaming Platform folks though, I
found that I can keep worker_processes configured as anything
other than 1, thereby maintaining the potential performance
gains, by also uncommenting multi_accept in the events block,
which is commented out by default in Debian and also enabling the
top level rtmp_auto_push option for this module:
---
events {
	worker_connections 768;
	multi_accept on;
}

rtmp_auto_push on;
---

This gives me a working configuration with no client hangs
observed.

	Assuming I'm not completely wrong about all of this, it's
probably worth mentioning in a README or some such in
/usr/share/doc at the very least as otherwise, people might have
a bad experience trying to make this module work consistently.

	Thanks!