Wowza Community

Load Balancing Setup

We need to setup a complete streaming architecture. For that I need your assistance in following.

  1. Setting up wowza loadbalancer using 3 server, this configuration should work for VOD and live streaming both.

I am confusing to setup loadbalancer module. Can i get some tutorial to setup.

There is a load balance package that includes a step by step guide:

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

This is generally used to support Livestream repeater (origin/edge configuration), but it is a completely separate system that just distributes connections and could just as easily be used to distribute connections to Wowza servers with video on demand applications.

Richard

You are connecting to two rtmp concatenated. “rtmp://yy.yy.yy.yy/liverepeter/definst/1_2:rtmp://198.168.1.223:1935/liverepeter/definst

You are probably using a .stream file on edge containing the rtmp url + streamName. In that case, make /originURL in the edge Application.xml empty. Just use the .stream file.

Richard

  1. The VHost.xml is not configured correctly, or you did not copy the package jar file to Wowza /lib folder, or you did not restart Wowza.

  2. The dynamic load balance system is not concerned with player protocols. One or more Load Balancer Sender (edge) servers is reporting to the Load Balancer Listener how many connections it has. The only part of this system that is specific to protocol is the NetConnection Method of redirecting connections. That will only work with Flash applications. For other players, e.g. IPhone or Silverlight players, you will have to use the HTTP method of getting the “least loaded server”. You can do this with a server-page in your application server which is responsible for retrieving least loaded server and dealing out pre-formed html pages to clients, or you could involve the player. Either way, you will be using the HTTP method rather then the NetConnection method.

  3. It’s not automatic, as explained above. To use VLC with load balancer, you would have to integrate with a web page that your server-page forms with least loaded server retrieved with HTTP method. See this post:

http://wiki.videolan.org/HowTo_Integrate_VLC_plugin_in_your_webpage

Richard

I’m not sure what you mean “break down”.

The ec2 instances are thought to have about 150mbs, 250mbs and 350mbs for the small, large and x-large instance, resp.

So you have to plan your deployment around these bandwidth limits.

Richard

The liverepeater (origin/edge) is completely separate from the Load Balancer. The LB distributes connections only, has nothing to do with streaming. The LB only tells a client which edge server to connect to. I try to explain in more detail here:

http://wowza.com/forums/showthread.php?9419-Load-Balancing-Issue/page2#13

The EC2 small, large and x-large instance types get about 150, 250 and 350mbs resp. The small is most cost effective cost/bandwidth.

Another option is use subscription license to run a cg1.4xlarge:

Cluster GPU Quadruple Extra Large Instance

22 GB of memory

33.5 EC2 Compute Units (2 x Intel Xeon X5570, quad-core “Nehalem” architecture)

2 x NVIDIA Tesla “Fermi” M2050 GPUs

1690 GB of instance storage

64-bit platform

I/O Performance: Very High (10 Gigabit Ethernet)

API name: cg1.4xlarge

You can’t use this instance type with Wowza devpay, you have to use a subscription license.

This cost is $1.60 an hour (Us East region, other regions vary) + subscription cost ($65 a month) + bandwidth usage. But no origin/edge configuration needed.

This is a very new instance type. It is perfect for this use case, but it is untested.

Richard

You’ll need to have a liverepeater-origin application and the load balancer on the origin server. You can also use it as an edge repeater.

Small can handle about 150Mbps, Large, about 250Mbps, and X-Large, about 350Mbps. If your stream is of a really low bandwidth, you’ll probably incur some overhead per connection.

-Ian

Hi Joe,

We don’t know where the upper limit is regarding Amazon’s total bandwidth out of EC2. I would suggest that prior to hitting any compute or bandwidth resource, you will either reach a limit in either (a) Amazon will cap the number of servers you can start (a limit to your credit with them) or (b) how many servers your staff wants to self manage prior to needing to pay your trusty CDN to utilize their staff in managing their servers.

What we do know is that the folks at Rambla (a Wowza Streaming Partner) handled 30,000 concurrent viewers during May 2009. You can read about it here:

So, in theory, you could contract a team like the guys at Rambla to just manage large live events with EC2. Of course, if you’re going to regularly need that much traffic, you can probably negotiate a reasonable contract with any of the Wowza Powered streaming partners listed here: http://www.wowza.com/partners.html

Hope that helps you set up some parameters for your business planning.

Yours,

John West

jonh-at-wowzamedia-dot-com

Hello,

I try with tutorial about load balancing. Everything go with no error, console show Balancer Server connected with Edge Server. But still have some points i want to know:

  1. I can not see serverInfoXML from web even on config enable = true. it show name and version of wowza now.

  2. I believe this balancing for every protocol, not only for Flash protocol, is that right? (example come with load balacing package is Flash)

  3. I think that client connect to Balancer and than Balancer will foward connection to edge servers automaticaly, Is that right and when it happen? I try using some VLC as clients but they all work on balancer, on edge show nothing.

Thank you.

I am testing with following setup:-

Origin:-

xx.xx.xx.xx

Edge:-

yy.yy.yy.yy

whenever i try to play the stream from edge.However I am able to place the steam from origin.

my error log is:-

[HTML]

INFO server comment - LiveMediaStreamHandler.connect: rtmp://yy.yy.yy.yy/liverepeter/definst/1_2:rtmp://198.168.1.223:1935/liverepeter/definst[1_2]

WARN server comment - Failed to connect: org.apache.mina.common.RuntimeIOException: Failed to get the session[ConnectException: null].

[/HTML]

here is my conf file:-

FOR EDGE-

<Root>
&#8722;
<Application>
&#8722;
<!--
 Uncomment to set application level timeout values
		<ApplicationTimeout>60000</ApplicationTimeout>
		<PingTimeout>12000</PingTimeout>
		<ValidationFrequency>8000</ValidationFrequency>
		<MaximumPendingWriteBytes>0</MaximumPendingWriteBytes>
		<MaximumSetBufferTime>60000</MaximumSetBufferTime>
		<MaximumStorageDirDepth>25</MaximumStorageDirDepth>
		
-->
&#8722;
<Connections>
<AutoAccept>true</AutoAccept>
<AllowDomains>*</AllowDomains>
</Connections>
&#8722;
<!--
			StorageDir path variables
			
			${com.wowza.wms.AppHome} - Application home directory
			${com.wowza.wms.ConfigHome} - Configuration home directory
			${com.wowza.wms.context.VHost} - Virtual host name
			${com.wowza.wms.context.VHostConfigHome} - Virtual host config directory
			${com.wowza.wms.context.Application} - Application name
			${com.wowza.wms.context.ApplicationInstance} - Application instance name
			
		
-->
&#8722;
<Streams>
<StreamType>liverepeater-edge</StreamType>
<StorageDir>${com.wowza.wms.context.VHostConfigHome}/content</StorageDir>
<KeyDir>${com.wowza.wms.context.VHostConfigHome}/keys</KeyDir>
&#8722;
<!--
 LiveStreamPacketizers (separate with commas): cupertinostreamingpacketizer, smoothstreamingpacketizer, cupertinostreamingrepeater, smoothstreamingrepeater 
-->
<LiveStreamPacketizers/>
&#8722;
<!--
 Properties defined here will override any properties defined in conf/Streams.xml for any streams types loaded by this application 
-->
<Properties>
			</Properties>
</Streams>
&#8722;
<!--
 HTTPStreamers (separate with commas): cupertinostreaming, smoothstreaming 
-->
<HTTPStreamers>cupertinostreaming,smoothstreaming</HTTPStreamers>
&#8722;
<SharedObjects>
<StorageDir/>
</SharedObjects>
&#8722;
<Client>
<IdleFrequency>-1</IdleFrequency>
&#8722;
<Access>
<StreamReadAccess>*</StreamReadAccess>
<StreamWriteAccess>*</StreamWriteAccess>
<StreamAudioSampleAccess/>
<StreamVideoSampleAccess/>
<SharedObjectReadAccess>*</SharedObjectReadAccess>
<SharedObjectWriteAccess>*</SharedObjectWriteAccess>
</Access>
</Client>
&#8722;
<RTP>
&#8722;
<!--
 RTP/Authentication/[type]Methods defined in Authentication.xml. Default setup includes; none, basic, digest 
-->
&#8722;
<Authentication>
<PublishMethod>digest</PublishMethod>
<PlayMethod>digest</PlayMethod>
</Authentication>
&#8722;
<!--
 RTP/AVSyncMethod. Valid values are: senderreport, systemclock, rtptimecode 
-->
<AVSyncMethod>senderreport</AVSyncMethod>
<MaxRTCPWaitTime>12000</MaxRTCPWaitTime>
<IdleFrequency>75</IdleFrequency>
<RTSPSessionTimeout>90000</RTSPSessionTimeout>
<RTSPMaximumPendingWriteBytes>0</RTSPMaximumPendingWriteBytes>
<RTSPBindIpAddress/>
<RTSPConnectionIpAddress>0.0.0.0</RTSPConnectionIpAddress>
<RTSPOriginIpAddress>127.0.0.1</RTSPOriginIpAddress>
<IncomingDatagramPortRanges>*</IncomingDatagramPortRanges>
&#8722;
<!--
 Properties defined here will override any properties defined in conf/RTP.xml for any depacketizers loaded by this application 
-->
<Properties>
			</Properties>
</RTP>
&#8722;
<MediaCaster>
&#8722;
<!--
 Properties defined here will override any properties defined in conf/MediaCasters.xml for any MediaCasters loaded by this applications 
-->
&#8722;
<Properties>
&#8722;
<Property>
<Name>streamTimeout</Name>
<Value>15000</Value>
<Type>Integer</Type>
</Property>
</Properties>
</MediaCaster>
&#8722;
<MediaReader>
&#8722;
<!--
 Properties defined here will override any properties defined in conf/MediaReaders.xml for any MediaReaders loaded by this applications 
-->
<Properties>
			</Properties>
</MediaReader>
&#8722;
<MediaWriter>
&#8722;
<!--
 Properties defined here will override any properties defined in conf/MediaWriter.xml for any MediaWriter loaded by this applications 
-->
<Properties>
			</Properties>
</MediaWriter>
&#8722;
<LiveStreamPacketizer>
&#8722;
<!--
 Properties defined here will override any properties defined in conf/LiveStreamPacketizers.xml for any LiveStreamPacketizers loaded by this applications 
-->
<Properties>
			</Properties>
</LiveStreamPacketizer>
&#8722;
<HTTPStreamer>
&#8722;
<!--
 Properties defined here will override any properties defined in conf/HTTPStreamers.xml for any HTTPStreamer loaded by this applications 
-->
<Properties>
			</Properties>
</HTTPStreamer>
&#8722;
<Repeater>
<OriginURL>rtmp://198.168.1.223/liverepeter</OriginURL>
<QueryString></QueryString>
</Repeater>
&#8722;
<Modules>
&#8722;
<Module>
<Name>base</Name>
<Description>Base</Description>
<Class>com.wowza.wms.module.ModuleCore</Class>
</Module>
&#8722;
<Module>
<Name>properties</Name>
<Description>Properties</Description>
<Class>com.wowza.wms.module.ModuleProperties</Class>
</Module>
&#8722;
<Module>
<Name>logging</Name>
<Description>Client Logging</Description>
<Class>com.wowza.wms.module.ModuleClientLogging</Class>
</Module>
&#8722;
<Module>
<Name>flvplayback</Name>
<Description>FLVPlayback</Description>
<Class>com.wowza.wms.module.ModuleFLVPlayback</Class>
</Module>
</Modules>
&#8722;
<!--
 Properties defined here will be added to the IApplication.getProperties() and IApplicationInstance.getProperties() collections 
-->
<Properties>
		</Properties>
</Application>
</Root>

When does load balancing via this method start to break down? I’d like to run a live stream through ec2 that I normally do with a CDN. I can expect a few thousand viewers at any one time.

I’m excited to offer a platform for all devices, but it seems a risk to not go with my trusty CDN account and start running servers on my own.

Joe

By “breakdown” I mean, what is the upper limit that someone should plan for in this type of infrastructure. I.E. when does the load balancing start to require something in addition to the below instructions?

Another way to look at it is: What is the largest known live event produced through ec2 using the load balance module?

Joe

Thank you John, that is exactly what I was looking for. I’m going to start out with 1 origin and 3 edge servers.

Joe

Hi Similar configuration here: trying 1 origin with load balancer and then x number of edges to support demand.

Still looking for answers:

  1. Is on the origina just load balancer is enought? or do I need repeater as well?

  2. What are viewers capacity / benchmar for EC2 relatively S, M, XL instances?

Any info would be appreciated.

Denis