Wowza, RTMP and haproxy

Hi forum,

I have Wowza set up successfully re-streaming an Icecast server over RTMP.

My service has occasional peaks of high activity and I want to employ a second EC2 instance during these periods. Before I started with Wowza, I successfully employed haproxy to balance a master/slave pair of Icecast servers, streaming MP3 over HTTP.

Is there anything to stop me performing the same feat with RTMP? I am thinking of setting up haproxy to proxy raw TCP data on port 1935, with each new connection going to an alternate instance of Wowza. (Both Wowza instances will be re-streaming a single Icecast server).

Does anybody have any experience with this? Or is there a better solution?

If anybody foresees any problems with this then I’d really appreciate learning about them now

thanks

Take a look at the Wowza Dynamic Load Balancing package:

https://www.wowza.com/docs/how-to-get-dynamic-load-balancing-addon

JW Player and Flowplayer have built-in support for the “redirect” application that you can set up on the Load Balancer. Or if you need to adapt to a custom player, there is sample client in the package, or you can refer to the Flex version LiveVideoStreaming example player (clientFlex)

Richard

HA proxy is most likely not going to work. RTMPT works in such a way as that each connection is unique. Also RTMPT is not very efficient. So it is best to use RTMP where you can and only fail over to RTMP when needed.

Charlie

I hate to bring up an old thread… but I recently just fronted a Wowza server with haproxy… and it seems to work really well so far. Granted I’ve not run it through the “ringer”… but so far it seems promising.

Proxying the raw tcp data to Wowza is working nicely. Both RTMP and RTMPT work great.

I’m telling Wowza to listen on port 1936 and then using haproxy to handle the incoming protocol.

For example… this is what I’m testing with:

listen wowza_proxy
	bind :1935,:443
	mode tcp
	balance roundrobin
	option httpchk HEAD /check.txt HTTP/1.0
	server wowza1 192.168.1.1:1936 weight 50 maxconn 512 check

Using the port tester here: http://www.jakehilton.com/?q=node/43 I get the following results:

MAC 10,3,183,10
RTMPT (Tunneling) Port 1935 Success 0.7s 
RTMPT (Tunneling) Port 443 Success 0.7s 
RTMPT (Tunneling) Port 80 Failed 0.4s 
RTMPT (Tunneling) Default Failed 0.4s 
RTMP Port 443 Success 0.4s 
RTMP Port 80 Failed 0.1s 
RTMP Port 1935 Success 0.4s 
RTMP Default Success 0.4s 
Test Completed

The connection times are very low and the proper ports are acting properly.

I have to test some streaming to see how that performs. Any thoughts why haproxy wouldn’t work like I hope? I’m testing with 1.4.18.

Thanks for any and all comments!

Jake

So after some quick streaming tests… it again is surprisingly positive. I don’t see bytes flowing through the stats page of haproxy right away… and it’s not until the stream ends that they’re reported.

But it works nicely.

I’ll keep testing and report.

Jake

I tested it working with multiple sessions to make sure it properly counts them and it does. Things are looking better and better.

I’m going to build out a larger block of Wowza servers and give it a test. Would be nice to manage all the servers from one place and have nice reporting on it as well.

Jake