# On Demand Load Balancing

**URL:** <https://community.wowza.com/t/on-demand-load-balancing/33772>\
**Category:** Wowza Streaming Engine\
**Created:** [October 4, 2010, 3:34pm UTC](https://community.wowza.com/t/on-demand-load-balancing/33772 "2010-10-04T15:34:20Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paulo\_Baptista](https://avatars.discourse-cdn.com/v4/letter/p/a6a055/32.png) [@Paulo\_Baptista](https://community.wowza.com/u/Paulo_Baptista)\
**Post date:** [October 4, 2010, 3:34pm UTC](https://community.wowza.com/t/on-demand-load-balancing/33772/1 "2010-10-04T15:34:20Z")

</div>

We use our Wowza server for an on demand application. We have the F5 load balancing available. Do the connections need to have server affinity?

There is no such thing as Origin/Edge for on demand application correct? I would need to have my content sync’d up with all the Wowza servers?

Thanks.

---

<div class="post-metadata">

**Author:** ![Paulo\_Baptista](https://avatars.discourse-cdn.com/v4/letter/p/a6a055/32.png) [@Paulo\_Baptista](https://community.wowza.com/u/Paulo_Baptista)\
**Post date:** [October 4, 2010, 3:41pm UTC](https://community.wowza.com/t/on-demand-load-balancing/33772/2 "2010-10-04T15:41:33Z")

</div>

Is MediaCache-AddOn an answer to the sync question I had?

[https://www.wowza.com/docs/how-to-scale-video-on-demand-streaming-with-media-cache](https://www.wowza.com/docs/how-to-scale-video-on-demand-streaming-with-media-cache)

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [October 4, 2010, 8:44pm UTC](https://community.wowza.com/t/on-demand-load-balancing/33772/3 "2010-10-04T20:44:45Z")

</div>

Yes it is.

I’m not sure about F5 load balancing. Wowza has a load balancing package:

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

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [October 5, 2010, 7:46pm UTC](https://community.wowza.com/t/on-demand-load-balancing/33772/4 "2010-10-05T19:46:04Z")

</div>

Yes. But using MediaCache is way for each “edge” to have access to the same content store.

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [October 20, 2010, 4:21pm UTC](https://community.wowza.com/t/on-demand-load-balancing/33772/5 "2010-10-20T16:21:09Z")

</div>

If you start an EC2 AMI with any startup package, the default startup package is used, which includes an application named “vods3”, which is an implementation of MediaCache customized for EC2 and S3. There is more details in the Wowza EC2 User Guide:

[https://www.wowza.com/resources/WowzaMediaServerForEC2\_UsersGuide.pdf](https://www.wowza.com/resources/WowzaMediaServerForEC2_UsersGuide.pdf)

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [October 20, 2010, 9:30pm UTC](https://community.wowza.com/t/on-demand-load-balancing/33772/6 "2010-10-20T21:30:02Z")

</div>

First, you will have to disable the EC2 version of MediaCache that is built-in and supports the Wowza EC2 application named “vods3”, which is designed to use S3. To do that you have to remove this ServerListener from /conf/Server.xml:

```auto
<ServerListener>
 <BaseClass>com.wowza.wms.plugin.amazonaws.ec2.mediacache.MediaCacheServerListenerAmazonEC2</BaseClass>
 </ServerListener>

```

Then you can configured the regular MediaCache package as normal.

To preserve that configuration for re-use, you can use a startup package. Which are detailed in the Wowza EC2 User Guide. It’s basically a set of files that mirror the Wowza configuration, or the parts that you want to be customized, and is zipped up and used when you launch an instance to automatically configure the instance. In this case you would include the modified Server.xml, and your application configurations and the mediacache jar. There is a size limit, so if the jar puts you over that you will have to use a Download tag in the startup.xml in the startup package. Details are in the Wowa EC2 guide.

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [October 21, 2010, 7:37pm UTC](https://community.wowza.com/t/on-demand-load-balancing/33772/7 "2010-10-21T19:37:27Z")

</div>

There is a wms-plugin-mediacache.jar on the Wowza EC2 instance, but it is not the same size as the one in the package.

You can try it, but I think you will probably have to overwrite it for your purposes with the jar in the MediaCache package.

Richard

---

<div class="post-metadata">

**Author:** ![Ian\_Beyer](https://avatars.discourse-cdn.com/v4/letter/i/e99b99/32.png) [@Ian\_Beyer](https://community.wowza.com/u/Ian_Beyer)\
**Post date:** [January 28, 2011, 10:05am UTC](https://community.wowza.com/t/on-demand-load-balancing/33772/8 "2011-01-28T10:05:33Z")

</div>

Is there anything that would preclude using the MediaCache add-on mentioned earlier in the thread?

-Ian

---

<div class="post-metadata">

**Author:** ![Paulo\_Baptista](https://avatars.discourse-cdn.com/v4/letter/p/a6a055/32.png) [@Paulo\_Baptista](https://community.wowza.com/u/Paulo_Baptista)\
**Post date:** [October 5, 2010, 2:36pm UTC](https://community.wowza.com/t/on-demand-load-balancing/33772/9 "2010-10-05T14:36:22Z")

</div>

Hi Richard,

Thanks for the feedback. So… to paraphrase… no Origin/Edge for on demand video… load balanced wowza servers either needs to have access to the same content store, or use MediaCache AddOn…

Paulo

---

<div class="post-metadata">

**Author:** ![Paulo\_Baptista](https://avatars.discourse-cdn.com/v4/letter/p/a6a055/32.png) [@Paulo\_Baptista](https://community.wowza.com/u/Paulo_Baptista)\
**Post date:** [October 20, 2010, 11:04am UTC](https://community.wowza.com/t/on-demand-load-balancing/33772/10 "2010-10-20T11:04:17Z")

</div>

How would one get MediaCache into Wowza Amazon EC2 solution?

---

<div class="post-metadata">

**Author:** ![Paulo\_Baptista](https://avatars.discourse-cdn.com/v4/letter/p/a6a055/32.png) [@Paulo\_Baptista](https://community.wowza.com/u/Paulo_Baptista)\
**Post date:** [October 20, 2010, 1:03pm UTC](https://community.wowza.com/t/on-demand-load-balancing/33772/11 "2010-10-20T13:03:58Z")

</div>

Thanks Richard.

So… 🙂 We want to scale Wowza streaming from on-premise server to Amazon if there is a demand.

This is my thinking. If our current on premise Wowza server reaches a certain limit (bandwidth, or current connections), we want our F5 GTM to switch over new DNS requests to our Amazon Wowza server. Before that happens we would need our on-premise Wowza server to trigger a Amazon EC2 startup. We want this Wowza Amazon EC2 to use MediaCache and point it back via http to our on-premise Wowza server (yes we will server up content via http). I don’t want to pay for S3 storage. We want the Cache storage to use the current Amazon AMI storage. We don’t need files to persist over between instance startups. Once the server load decreases on the on-premise Wowza server, our F5 Load Balancer would send new requests back to on-premise. We would then shutdown the Amazon instance.

So… The only thing we need to persist is the MediaCache config that points back to our http content. How can I set that up?

---

<div class="post-metadata">

**Author:** ![Paulo\_Baptista](https://avatars.discourse-cdn.com/v4/letter/p/a6a055/32.png) [@Paulo\_Baptista](https://community.wowza.com/u/Paulo_Baptista)\
**Post date:** [October 21, 2010, 11:14am UTC](https://community.wowza.com/t/on-demand-load-balancing/33772/12 "2010-10-21T11:14:22Z")

</div>

I appreciate your help with this Richard! Excellent!

---

<div class="post-metadata">

**Author:** ![Paulo\_Baptista](https://avatars.discourse-cdn.com/v4/letter/p/a6a055/32.png) [@Paulo\_Baptista](https://community.wowza.com/u/Paulo_Baptista)\
**Post date:** [October 21, 2010, 1:51pm UTC](https://community.wowza.com/t/on-demand-load-balancing/33772/13 "2010-10-21T13:51:49Z")

</div>

I took a look at the vods3.zip startup package and it doesn’t include any mention of the jar file. So… to me that implies that the mediacache.jar is in the AMI. All I would need to do it use a startup package with the configured application and a customized MediaCache.xml file.

---

<div class="post-metadata">

**Author:** ![Paulo\_Baptista](https://avatars.discourse-cdn.com/v4/letter/p/a6a055/32.png) [@Paulo\_Baptista](https://community.wowza.com/u/Paulo_Baptista)\
**Post date:** [October 22, 2010, 9:00am UTC](https://community.wowza.com/t/on-demand-load-balancing/33772/14 "2010-10-22T09:00:32Z")

</div>

I bit the bullet and signed up for Wowza Amazon EC2. The AMI does include the mediacache.jar and it works fine. I reconfigured it to use the http backend and used the AMI /mnt/mediacache for cache storage. Next step is to create startup package to do this automatically for me. Thanks!

---

<div class="post-metadata">

**Author:** ![Nico\_McLane](https://avatars.discourse-cdn.com/v4/letter/n/f17d59/32.png) [@Nico\_McLane](https://community.wowza.com/u/Nico_McLane)\
**Post date:** [January 28, 2011, 10:56am UTC](https://community.wowza.com/t/on-demand-load-balancing/33772/15 "2011-01-28T10:56:51Z")

</div>

Hi Richard, I am considering a hybrid Origin Origin with Origin Edge implementation for a Global eCDN - what I am hoping to do is find a way to replicate content across regions to the Origin (like APAC to London, big spans - some files will take a long time to replicate over) - what do you suggest? I am trying to find a solution that has some kind of error checking built in to it… I’ll be testing on EC2 with S3 for content. thoughts?
