I'm using FMS as origin and i want to use nginx-rtmp as edge repeater with pull feature,however i see clients as connected(same channel) to nginx as nginx will connect to FMS (with FMS EDGE only one connection to origin).
eg: (3)clients---->nginx--->(3 connections)--->fms
i want nginx only have one connection connect to FMS and reuse for any clients.
can you help me?
How many workers do you have? NGINX-RMTP creates one upstream (pull) connection per worker.
I'm configuring 16 worker processes and auto_push enabled.
188.8.131.52:45333 184.108.40.206:1935 ESTABLISHED 10996/nginx: worker
220.127.116.11:45318 18.104.22.168:1935 ESTABLISHED 10994/nginx: worker
22.214.171.124:45302 126.96.36.199:1935 ESTABLISHED 10992/nginx: worker
188.8.131.52:1935 184.108.40.206:49982 ESTABLISHED 10996/nginx: worker
220.127.116.11:1935 18.104.22.168:1042 ESTABLISHED 10992/nginx: worker
22.214.171.124:1935 126.96.36.199:1055 ESTABLISHED 10994/nginx: worker
Auto-push does not matter in your case. You'd better turn it off. One upstream connection per worker will be created.
Ok,I have set to 1 worker and it has worked well.
I meant you can have multiple workers with auto-push disabled. In this case all your workers will be independent and each will have one pull connection to backend. That will also work well.
I also disabled auto-push,however my system has 20 tv channels(channel's bitrate ~1.5Mb/s),upstream bandwidth is low,average 20-30Mb/s,if i use multiple workers(in this case 16 workers) then bandwidth for upstream is not enough,i want one upstream connection per channel(save upstream bw).Workaround,i have set to 1 worker process(although impact of performance) and i'm must spiliting nginx-rtmp into other instance.
@trongltvs : do like this: clients -> nginx with X worker -> nginx with 1 worker at localhost:2345 -> fms. The second nginx fetch the stream from fms with one connection, and the public nginx workes are connecting to this nginx.
@Elbandi : Thanks for your help,i will test.
@arut : is there a solution to share upstream connection between workers?
In theory that's possible. I need to improve relay & auto-push modules for that.
Systems with more edge servers,i think that feature should be added for scability.
Again,thank to Arut for the help.