Pull feature #86

Closed
trongltvs opened this Issue Oct 7, 2012 · 10 comments

Projects

None yet

3 participants

@trongltvs

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?
Thanks

@arut
Owner
arut commented Oct 7, 2012

How many workers do you have? NGINX-RMTP creates one upstream (pull) connection per worker.

@trongltvs

I'm configuring 16 worker processes and auto_push enabled.
netstat:
113.161.0.253:45333 123.29.69.4:1935 ESTABLISHED 10996/nginx: worker
113.161.0.253:45318 123.29.69.4:1935 ESTABLISHED 10994/nginx: worker
113.161.0.253:45302 123.29.69.4:1935 ESTABLISHED 10992/nginx: worker
113.161.0.253:1935 123.29.67.162:49982 ESTABLISHED 10996/nginx: worker
113.161.0.253:1935 123.29.67.162:1042 ESTABLISHED 10992/nginx: worker
113.161.0.253:1935 123.29.67.162:1055 ESTABLISHED 10994/nginx: worker

@arut
Owner
arut commented Oct 7, 2012

Auto-push does not matter in your case. You'd better turn it off. One upstream connection per worker will be created.

@trongltvs

Ok,I have set to 1 worker and it has worked well.
Thanks.

@arut
Owner
arut commented Oct 7, 2012

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.

@trongltvs

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.

@Elbandi
Elbandi commented Oct 8, 2012

@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.

@trongltvs

@Elbandi : Thanks for your help,i will test.
@arut : is there a solution to share upstream connection between workers?

@arut
Owner
arut commented Oct 8, 2012

In theory that's possible. I need to improve relay & auto-push modules for that.

@trongltvs

Systems with more edge servers,i think that feature should be added for scability.
Again,thank to Arut for the help.

@arut arut closed this Nov 13, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment