# EC2 Instances: Purpose of CloudFront?

**URL:** <https://community.wowza.com/t/ec2-instances-purpose-of-cloudfront/41362>\
**Category:** Wowza Streaming Engine\
**Created:** [October 5, 2013, 10:01am UTC](https://community.wowza.com/t/ec2-instances-purpose-of-cloudfront/41362 "2013-10-05T10:01:13Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adam\_Tirapelle](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@Adam\_Tirapelle](https://community.wowza.com/u/Adam_Tirapelle)\
**Post date:** [October 5, 2013, 10:01am UTC](https://community.wowza.com/t/ec2-instances-purpose-of-cloudfront/41362/1 "2013-10-05T10:01:13Z")

</div>

I apologize in advance if this is a simple question, but I can’t seem to find a straight answer.

This is for live event only streaming and I’ve already been able to successfully set up and test both the Wowza Media Server on an EC2 Instance both with and without using CloudFront for distribution. We’re encoding using Teradek Cube at 2.5-3.5Mbps, transcoding a cascade of lower bitrates using the Wowza Transcoder AddOn (transrate actually), and providing an adaptive bitrate HLS stream to JW Player, which users will view on our website via Flash or HTML5.

But now trying to get prepared for many simultaneous users for the actual live events and I don’t have the answers OR know how to simulate lots of users for testing. Does the use of CloudFront allow more users (in terms of throughput measured in Mbps and/or connections) to an HTTP feed or just faster access time for the same number of users per Wowza instance? I guess my question is, are we going to need multiple Wowza Media Server instances if we are using CloudFront if we are expecting, let’s just say 1,000 simultaneous users ranging from connections of 2.5Mbps to 400kbps? If you’re needing an exact figure, let’s just say 2,500 Mbps throughput (probably lower but this will be a safe estimate).

If the answer is YES on needing multiple instances, would anyone mind posting how to set up Elastic Load Balancer (or whatever is needed) on EC2 to ingest a single input source but balance over enough instances to allow the target audience to connect with a low latency, smooth video experience? I have been able to find out how to set all of this up on a single Wowza instance (used Hi-CPU XLarge for testing-c1.xlarge), but am not adept enough to provision multiple servers for optimization purposes.

Thanks in advance for any potential guidance. If I’m missing any needed information, please let me know and I’ll reply ASAP.

---

<div class="post-metadata">

**Author:** ![Adam\_Tirapelle](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@Adam\_Tirapelle](https://community.wowza.com/u/Adam_Tirapelle)\
**Post date:** [October 5, 2013, 1:24pm UTC](https://community.wowza.com/t/ec2-instances-purpose-of-cloudfront/41362/2 "2013-10-05T13:24:19Z")

</div>

Also noticing that with CloudFront distribution, the .smil manifest files no longer are recognized, or at least don’t seem to be working. With just the EC2 Wowza Server and JW Player, the following worked with dynamic switching enabled:

```auto
http://[wowza-origin-address]/live/smil:myStream.smil/manifest.m3u8

```

Now, in order to play the stream (without the dynamic switching), only this will work:

```auto
http://[cloudfront-address]/live/myStream/manifest.m3u8

```

Is this a function of CloudFront at the edge locations not being able to use .smil file? Or am I missing something/doing something wrong?

---

<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:** [January 3, 2014, 1:50pm UTC](https://community.wowza.com/t/ec2-instances-purpose-of-cloudfront/41362/3 "2014-01-03T13:50:24Z")

</div>

Right, Wowza as an origin is not aware of playback clients that are streaming from the Cloudfront cache.

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:** [January 6, 2014, 12:45am UTC](https://community.wowza.com/t/ec2-instances-purpose-of-cloudfront/41362/4 "2014-01-06T00:45:22Z")

</div>

In JW Player, it would only work when it is using the .m3u8 url for playback, but not RTMP playback using Cloudfront. Only the HTTP stream types are supported.

You can use a OSMF2 player to playback HDS stream in Flash. Test with the Flash HTTP Wowza example player. Or use this [OSMF2 configurator](http://osmf.org/dev/2.0gm/setup.html).

The .smil file in the Wowza origin /content folder is propagated to the CF edges.

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:** [January 6, 2014, 1:14am UTC](https://community.wowza.com/t/ec2-instances-purpose-of-cloudfront/41362/5 "2014-01-06T01:14:36Z")

</div>

[OSMF configurator](http://osmf.org/dev/2.0gm/setup.html)

---

<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:** [January 6, 2014, 3:37pm UTC](https://community.wowza.com/t/ec2-instances-purpose-of-cloudfront/41362/6 "2014-01-06T15:37:55Z")

</div>

It allows for more users in terms of throughput. It may also benefit access time in some cases, overall, though there would be many factors.

Richard

---

<div class="post-metadata">

**Author:** ![teddy\_wellwood](https://avatars.discourse-cdn.com/v4/letter/t/a9a28c/32.png) [@teddy\_wellwood](https://community.wowza.com/u/teddy_wellwood)\
**Post date:** [January 2, 2014, 7:47pm UTC](https://community.wowza.com/t/ec2-instances-purpose-of-cloudfront/41362/7 "2014-01-02T19:47:12Z")

</div>

Hi. I would also like a better understanding of this AWS CloudFront question regarding live streaming. Does each CF edge server cache a copy of each live video segment OR does it cache a copy of each video segment PER USER because of the session ID in the url? In the first case cloud front acts as a wowza edge service or application layer multicast service and the origin server will get 41 connections at most (one from each CF edge server). In the second case the edge servers will make a new request for the same content for each user. The origin server will service every single request without the benefit of origin edge load distribution.

---

<div class="post-metadata">

**Author:** ![teddy\_wellwood](https://avatars.discourse-cdn.com/v4/letter/t/a9a28c/32.png) [@teddy\_wellwood](https://community.wowza.com/u/teddy_wellwood)\
**Post date:** [January 2, 2014, 8:17pm UTC](https://community.wowza.com/t/ec2-instances-purpose-of-cloudfront/41362/8 "2014-01-02T20:17:03Z")

</div>

I found the answer to my question here:

[https://www.wowza.com/docs/how-to-integrate-your-wowza-ec2-instance-with-cloudfront#about](https://www.wowza.com/docs/how-to-integrate-your-wowza-ec2-instance-with-cloudfront#about)

so it seems the origin will only see one connection from each CF edge server. But wowza session info is lost.

---

<div class="post-metadata">

**Author:** ![Johan\_Niemi](https://avatars.discourse-cdn.com/v4/letter/j/a183cd/32.png) [@Johan\_Niemi](https://community.wowza.com/u/Johan_Niemi)\
**Post date:** [January 6, 2014, 1:08am UTC](https://community.wowza.com/t/ec2-instances-purpose-of-cloudfront/41362/9 "2014-01-06T01:08:33Z")

</div>

tirapell asked some interesting questions three months ago, anyone care to address them?

---

<div class="post-metadata">

**Author:** ![Johan\_Niemi](https://avatars.discourse-cdn.com/v4/letter/j/a183cd/32.png) [@Johan\_Niemi](https://community.wowza.com/u/Johan_Niemi)\
**Post date:** [January 6, 2014, 11:38am UTC](https://community.wowza.com/t/ec2-instances-purpose-of-cloudfront/41362/10 "2014-01-06T11:38:18Z")

</div>

Does the use of CloudFront allow more users (in terms of throughput measured in Mbps and/or connections) to an HTTP feed or just faster access time for the same number of users per Wowza instance?
