Fixed problem with RTMPT

584 views
Skip to first unread message

Tiago Daniel Jacobs

unread,
Aug 28, 2012, 8:38:05 PM8/28/12
to Bbb-dev
Hello community.

We was working on fixing problem of disconnections when using RTMPT. Using a network sniffer we discovered that connection was reseted by nginx at every 100th packet (Connection: close). It was making the flash player send a "close" call.

We discovered it's a misconfiguration of nginx of bbb-vm.

If you are having problems with disconnections when using RTMPT connection, do the following steps:

1 ) Edit file /etc/nginx/sites-enabled/bigbluebutton

2 ) Locate this piece of configuration file (underlined):
location ~ (/open/|/close/|/idle/|/send/|/fcs/) {
          proxy_pass         http://127.0.0.1:5080;
          proxy_redirect     off;
          proxy_set_header   X-Forwarded-For   $proxy_add_x_forwarded_for;

          client_max_body_size       10m;
          client_body_buffer_size    128k;

          proxy_connect_timeout      90;
          proxy_send_timeout         90;
          proxy_read_timeout         90;

          proxy_buffering            off;
      }
3 ) After the proxy_buffering, add the following line:
keepalive_requests 1000000000;
4 ) Your configuration should be like this:
location ~ (/open/|/close/|/idle/|/send/|/fcs/) {
          proxy_pass         http://127.0.0.1:5080;
          proxy_redirect     off;
          proxy_set_header   X-Forwarded-For   $proxy_add_x_forwarded_for;

          client_max_body_size       10m;
          client_body_buffer_size    128k;

          proxy_connect_timeout      90;
          proxy_send_timeout         90;
          proxy_read_timeout         90;

          proxy_buffering            off;
          keepalive_requests 1000000000;
      }

5 ) Enjoy

Regards,
TDJ
www.imdt.com.br

Fred Dixon

unread,
Aug 28, 2012, 9:19:59 PM8/28/12
to bigblueb...@googlegroups.com
Thanks Tiago!!

This problem has been biting us in the ass.  We'll update the packaging for 0.81-beta so it includes your fix.  For 0.80, folks can follow your steps below.

Regards,... Fred
-- 
BigBlueButton Developer
BigBlueButton on twitter: @bigbluebutton



--
You received this message because you are subscribed to the Google Groups "BigBlueButton-dev" group.
To post to this group, send email to bigblueb...@googlegroups.com.
To unsubscribe from this group, send email to bigbluebutton-...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/bigbluebutton-dev?hl=en.





Tiago Daniel Jacobs

unread,
Aug 29, 2012, 1:58:57 PM8/29/12
to bigblueb...@googlegroups.com, bigblueb...@googlegroups.com
Team, the configuration i sent minimized the problem. But we still having disconnections. 

Lets update to latest red5, so i can debug it better. I'm not sure If we will do it for 0.81.

What do you think Fred? 

Regards,
TDJ
www.imdt.com.br


Fred Dixon

unread,
Aug 29, 2012, 2:19:21 PM8/29/12
to bigblueb...@googlegroups.com
Hi Tiago,

We were planning on updating to the latest red5 for 0.81-beta, but if you can try it first and give us feedback, that would be great.


Regards,... Fred
-- 
BigBlueButton Developer
BigBlueButton on twitter: @bigbluebutton


Nadia Nouri

unread,
Aug 29, 2012, 2:22:41 PM8/29/12
to bigblueb...@googlegroups.com
Tiago, 

After how long you get disconnected after configuring the keepalive_request/

What about disabling the keepalive itself? instead of increasing the keepalive ping time? 

keepalive_timeout 0; 

I tried that and it looks it is working fine so far, after 40 min and still connected (voice, video and chat) ! I was getting disconnected after few seconds before disabling the keepalive. 

By the way, which browsers you are testing with? I got incosistant behaviour using different browsers (i.e. Chrome, Safari and Firefox) Firfox was the worst. 

LMK. 

Thank..,..Nadia 


“'Free software' is a matter of liberty, not price. To understand the concept, you should think of 'free' as in 'free speech,' not as in 'free beer'.” -Richard M. Stallman

Kozlov Sergey

unread,
Dec 10, 2013, 10:48:15 AM12/10/13
to bigblueb...@googlegroups.com
Hello,

I was still experiencing problems with RTMPT on 0.81 final even with keepalive_requests and proxy_buffering fixes.
I've tried Nadia's fix, but it caused a vast amount of connections beetween client and server drop in TIME_WAIT, so I thought it was not so good idea.

I've found the fix on one of nginx's modules manual pages here and added the following line to my nginx config

location ~ (/open/|/close/|/idle/|/send/|/fcs/) {
          proxy_pass         http://127.0.0.1:5080;
          proxy_redirect     off;
          proxy_set_header   X-Forwarded-For   $proxy_add_x_forwarded_for;

          client_max_body_size       10m;
          client_body_buffer_size    128k;

          proxy_connect_timeout      90;
          proxy_send_timeout         90;
          proxy_read_timeout         90;

          proxy_buffering            off;

          keepalive_requests         1000000000;
          proxy_set_header  Connection: Keep-Alive;
      }

This forces all the connections through proxy_pass to be persistent, so they don't drop spontaneously.
There are still a lot of connections (about 2000-3000 in TIME_WAIT per RTMPT tunnel) inside the server, but not between the server and clients.
The fix did not raise the load on the server.

Before that client connected through RTMPT was disconnected after 40 min maximum.
After that I was connected through RTMPT to the server for whole 4 hours using VoIP and chat from time to time.

If anyone is experiencing the same problem on the 0.81 final, please, give this fix a test because this bug is very hard to repeat.

That is (was?) a hell of a bug, and I hope it's finally gone.

Regards,
Kozlov Sergey.

Fred Dixon

unread,
Dec 10, 2013, 10:56:49 AM12/10/13
to BigBlueButton-dev
Hi Kozlov,

Thanks for sharing this, added your suggestion to this issue


Regards,... Fred


--
You received this message because you are subscribed to the Google Groups "BigBlueButton-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bigbluebutton-...@googlegroups.com.

To post to this group, send email to bigblueb...@googlegroups.com.

pablo platt

unread,
Dec 10, 2013, 12:00:35 PM12/10/13
to bigblueb...@googlegroups.com
Kozlov,

Can you explain why  proxy_set_header  Connection: Keep-Alive; is requred?

Thanks

Kozlov Sergey

unread,
Dec 10, 2013, 12:22:20 PM12/10/13
to bigblueb...@googlegroups.com
pablo,

I don't really know all the black magic behind that but I saw people getting similar problems with proxy_pass. I found the reference to solution on Russian nginx forum link here (it is down while I'm writing). Also there is something like that discussed here.

I think there's something about nginx not forwarding the "Connection: Keep-Alive" header through the proxy_pass, so we have to add it by hand.

Regards,
Kozlov Sergey.

Kozlov Sergey

unread,
Jan 24, 2014, 11:49:58 AM1/24/14
to bigblueb...@googlegroups.com
Hello, community.

I've been using this fix for more than a month now, and I can *declare* it does work.

Please, try it in your environment and leave a post so it can be included in the next release (errata maybe?)

Regards,
Kozlov Sergey.

Fred Dixon

unread,
Jan 24, 2014, 12:51:57 PM1/24/14
to BigBlueButton-dev
Marking it to be added to 0.9.0.


Regards,... Fred
Reply all
Reply to author
Forward
0 new messages