Low Cost Webcast Optimizations?
ChunKing asks: "I work for a small community broadcasting organization, and we operate a limited streaming media facility for a number of not-for-profit webcasters. It has always been an issue to optimize our streaming media infrastructure to most benefit our users. We operate a small cluster of servers from a data center with good connectivity and a highly-rated ISP, who will occasionally allow us to burst to unlimited bandwidth. For big webcasts, we will load balance the stream over a number of servers using round robin DNS. However, we still get problems with stream buffering and network drop-outs, particularly with streaming video. We cannot afford a network of edge delivery servers like Akamai, so in what ways can we further optimize our streaming media capacity to better produce smooth webcasts?"
"who will occasionally allow us to burst to unlimited bandwidth"
Well, unless your provider has "unlimited bandwidth" themselves, you're basing your webcast on a lie. Pretty much no one has unlimited bandwidth; even a couple hundred broadband streams can saturate an OC-3 connection.
What you need to do is plan your webcasts a little better and ask a bunch of questions: What's the real bandwidth your ISP can provide (with redundancy)? What's the buffer size that your client apps are using? (Settable in some clients, like Flash.) Does your ISP (who promised you unlimited bandwidth) even know what the hell they're doing?
Without going to a dedicated CDN like Akamai, it's still pretty easy to design a distributed service network with colocated servers scattered across the country. You might want to consider finding someone who knows this kind of thing and paying them a few bucks to fix your problems...
There was a system that came out to do this. There are numerous problems, including differential lag times between servers and firewalls. Most importantly, unlike torrents, you need to stream media in a linear fashion. The great thing about BitTorrent is you can get, say, piece 53 from one guy and piece 173 from another guy at the same time. Here, you'd have a mad rush for pieces 1 and 2 right from the outset. Also, I suspect it's much harder to get people to 'seed' stuff in the media world. I believe there's still some sort of system based on shoutcast that does this, though, if you want to look it up.
Free Conference Call -- No Spam, High Quality
Streaming? Are you for real, that is so 1997. Just more old media companies trying to push their way of doing things on the net. Give up on streaming. Produce several quailty versions of the same file support a few differnt codecs mp4, xvid, wmv... and setup torrents for each file. Then use your limited bandwidth to deliver the torrent files, run the tracker and with the remaining bandwidth seed the torrents with a good bittorrent client. Why suffer quailty and bandwidth requirements just so the show can be 'live'? I suspect you arn't even showing live events so why streaming? Stop thinking like a TV broadcaster and start thinking like an internet distributer.
Multicast.
You mention a lot of factors, but you haven't said what area you're having the most problem with. Have you at least managed to identify what the actual bottleneck is? It could be bandwidth at your servers, or between your ISP and some peer (through which most of your traffic is going), or it could be CPU load on your servers, or it could be disk I/O limits on your servers, or it could be lack of memory on your servers (causing them to thrash), or it could be uneven load balancing to DNS-based load balancing being somewhat random, or it could be that you've reached the maximum capacity (in terms of hosts per response record in DNS) with DNS load balancing and you need to add another layer of load balancing.
The first step is going to be to check into all those areas and identify where the failure is currently happening. Once you know that, the solution will be more obvious. You might just need to add striping for your disks (to increase throughput by brute force) or RAM (to be able to cache all active streams) if the problem is that your disks can't keep up. But, if your ISP's connection to a major peer isn't sufficient, then you will need to do something much more involved (and will probably include gathering data during an actual event where the streaming can't keep up in order to prove that the ISP is the problem).
Stay away from CDNs if you're looking for performance (if it's pricing you're after, that's a seperate issue) - they are likely dealing with all the same issues that you are. Except that when something goes wrong, there's nothing you can do except shrug and say "it's the CDN's fault". My organization went to a CDN to save on ridiculous colo bills, and we heard all the claims about performance with skepticism, but we were shocked to find that despite all the "second generation edge servers" our CDN has, thruput actually went DOWN significantly when we switched to them. We didn't much care since it was saving us a lot of money and was usually unnoticeable or at least bareable...
:)
But to return to your original question - since you're dealing with not-for-profits, clearly the answer is a live streaming P2P "edge network". Let me know when you release that code
If you don't have the development resources for that, the best solution is probably to scale down your investment in your current colo and pop a few servers in a different geographic locale, a kind of DIY edge network. With 3 or 4 colos (say, Europe, US-East, US-West), and smart determination of which host to route to using Geo::IP or the like, you could probably save a lot of traffic and latency.
Xiph is working on a system like the one you describe.
You can find their informal wiki page at http://wiki.xiph.org/IceShare
http://ourmedia.org/ is setup for just such occassions. My video podcasts to a 100,000 people in the last month without complaint. CC friendly. And free.
heh, I love the people who think Coral Cache is this big giant unlimited source of bandwidth.. its slow, latent, and unusuable for this application
Kinda like this?
Is there anything better than clicking through Microsoft ads on Slashdot?
Seriously, because ISPs generally do not support multicast (even though their hardware does, it's just disabled, it requires 5 seconds to turn on, and is likely native downstream of them anyway), it is better to do this the way NASA Select did with their TV broadcasts in the days of CU-SeeMe. (Great program, died an ugly death, and is now a zombie in the hands of a corporation.)
What NASA did was to multicast for anyone who could get multicast to receive, but ALSO to reflectors that supported unicast connections. Users without multicast could then hook up to the nearest reflector and get the broadcast with only marginal extra latency.
Because multicast reduces the number of streams (to one), you have the benefit of being able to boost the quality of the transmission. Typical webcasts are maybe 320x200 at 5 seconds a frame. If you're lucky. A typical MBone transmission is very close to NTSC resolution at 15 frames per second, because the users have that much extra bandwidth to play with. That kind of a dramatic improvement in quality draws attention, which means that if this is a payed service (multicasting supports those), you're likely to improve not only the output but the revenue as well.
Because this is a broadcast-only system, the flavour of multicasting most likely to be of interest is SSM (Source-Specific Multicasting) where only designated endpoints (in this case the webcast transmitter) can send, all others receive.
Remember, multicasting is your friend.
It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
Check the load on the servers... that's not your problem. Check your bandwidth pipe. That is your bottle neck. Now just because you might have a 20 MB pipe doesn't mean you have 20 MB to the Internet. Bandwidth providers are famous for overselling pipes... that's how they make money! What you need to look into is getting a second ISP that feeds from a different data center than the one you have now. Now another option is to co-locate to a center that has multiple ISP feeds and place a publishing server at that location. Therefore you only use the bandwidth at your current site to send the feed to the co-location. They will most likely have three to four ISP feeds to the Internet and the cost is a lot less than adding more bandwidth and edge network services. With you being a non-profit you've got to have some leeway to get a better pricing deal.
It sounds like your problem is bandwidth. Either on the client-side, coming off your net to your ISP, or routing problems elsewhere on the Internet. The hard part is tracking down where the bottleneck is. Try to have multiple end-user test points. The company I work for has employees on a couple of different local ISPs and servers at various colo facilities. Try logging in to each machine and testing the stream. If it's across the board, you can safely bet it's your "unlimited" pipe to your ISP or a problem at your ISP. If it's a problem with a fraction of the clients, try doing traceroutes and see how the packets hop across the Internet and look for any similarities to see where the hang-ups can be. It's also possible that some clients just aren't getting the bandwidth they think they should be getting. Try everything you can to optimize your streaming application of choice. Reduce the number of FPS if you can. If it's only a talking head or something with little movement, try spacing out the keyframes more. Unless you're broadcasting a music video or movie, try using mono instead of stereo for audio. If it's a speech, you probably don't need CD-quality sound. Dropping the sound to 32, 24, or even 16kbps for a WMA/MP3/RA stream will still sound decent for something that doesn't have a lot of variation in sound.
Also, if it is possible, try to expirament around with variable bit-rate streams for video and/or audio. That can come in handy if your target audience spreads from AOL dial-up in the middle of nowhere to your urban 8 Mbps+ broadband connections.
In streaming, the big three big things that you have to worry about are the encoder's connectivity (to push the stream to the distribution point), the encoder's power (to make sure it can really compress all that video without overheating or dropping frames), and the distribution point's connectivity. Distribution servers don't use much bandwidth as all they do is simply regurgitate the data back out to clients without having to do any processing other than logging.
I've been doing streaming for about 5-6 years now. I've done everything from web cam streaming to large convention streaming that put out 300+ Mbps of connectivity. By no means am I an expert (I've done streaming--it's not what I do), but everything above is my experience with it. Most of all, just stick with what you know and are comfortable with. Your client base will determine most things. Personally (even being a BSD guy), my preferred streaming setup is using Windows Media Encoder at the source, Windows Media Server 2003 at the distribution point, and Windows Media Player (or anything else that can play Windows Media v9) at the end-user. In my experience, it has been rock-solid and can be deployed quickly. If you're already running Windows 2000/XP/2003, all the software mentioned above is provided free-of-charge.
Hope this helps.
Cool link..though from what I see it only works with pre-recorded stuff and wouldn't be useful for live webcasting as is the intention of the OP. After all, it's tough to get pieces of a broadcast from other clients when it hasn't been created yet :p Unless, of course, one is willing to have clients cache segments of the broadcast...and distribute that to other clients (with a noticeable latency to those further "downstream"). Going that way seems kinda kludgy to me. Something along the lines of skype would be better suited...where it builds a multi-cast-like tree of nodes and supernodes that could be used to distribute live content while providing a much greater scaling factor over the 1:1 that OP currently is getting (though not as good as a bit torrent type architecture would yield), and is suitable for distributing live content where everyone has similar latency, rather than "tiers" of latency. Just an idea...
First, I can give you unlimited bandwidth on a Dial up line but you're not going to stream video over it, so any ISP that is giving you "unlimited" probably isn't set up to host your video. ;-)
Second on YouTube and Google
I agree there is something to be said for "out sourcing" your video to a company like Google Video or YouTube, but if you don't mind I would like to throw my little Start-Up (Vidiac.com) into the ring since we've been doing free video hosting longer than either of those two without all the Web 2.0 Hype. Of course the difference with us is we give you a video hosting portal you can run on your website (Like video.YOURDOMAIN.com), so with us you can start your own "Flickr of Video" either free (ad supported) or pay-per stream. Sorry about the self promotion there.
Regarding your Dilemma
Here is my input on the question at hand based on my own experience (I'm streaming just over a million streams a day to 2.5 Million Unique visitors a month). First, as always, start with the needs of the users.
1.) Are they sophisticated? How would they react to a Torrent? From my experience, if someone has a torrent client installed then they're fine with it, but if they don't you have a large "fear factor" to overcome convincing a user to install a program to watch your video.
2.) Do they want to click and Watch, (stream), or do they want to download? If you produce content like a video podcast, then I highly recommend giving your users a download option over streaming. If you run a portal-site, like Big-Boys.com that aggregates content then you're better off streaming as you want to be viewed as more than an FTP site.
3.) How big is your Audience? This is probably the single biggest factor for capacity planning. If they all hit your site at once you need a ton of bandwidth.
4.) Is this a scheduled broadcast (like a weekly show), or is this content that will be downloaded over time? Scheduled events can cause massive spikes. 10,000 users all at once is harder on a server than a Million users spread out over a month.
5.) What video quality will your users tolerate? What Software can they use to view it? Windows Media? Quicktime? Flash? Size? Bit Rate? If your users are watching these videos on an iPod they'll accept a lower quality than if they're viewing it on their Plasma HDTV.
Based on the above you can get a firm handle on your
1.) Delivery Method (Direct Download, stream, Torrent)
2.) Video Size (Format, Quality, etc)
3.) Pipe Size (How much do you need to stream at once)
3.) Bandwidth Utilization profile (spikes and valley vs. flat)
Compare the above to your current solution. If your users are buffering, is it because...
Your upload pipe is saturated? Upgrade to a larger pipe (100Mbps is about the minimum if you have more than 10 people hitting your video at the same time)
Is your Disk I/O saturated? SATA and IDE are fine for most sites, but if you have 50 viewers requesting 30 different videos you need some strong I/O. we were burning through SATA drives on a weekly basis before switching to a SCSI SAN.
Does your ISP have proper Network access to get to your end users? Consider pulling in a pipe from an appropriate network. (AT&T strongly peers with Cox cable for instance, MCI has fantastic AOL connectivity).
Anyhow, I hate to answer a question with more questions, but there are so many ways to deliver video, there is no one silver bullet solution. You just have to do what works for your users and company. From experience though capacity planning for an online video application takes a lot of work, but once you wrap your head around the bandwidth issue, it gets easy. Good Luck!
-Adam
What you're describing sounds like PeerCast. http://www.peercast.org/ I've tried it with some radio stations.. connectivity rate seems to suffer, but otherwise, there aren't any issues with quality (but I only used for radio, not video)
First, forget round robin DNS. It simply doesn't work. You cannot rely on the DNS clients to select the round-robin IP addresses in order except under very rare circumstances.
Second, if it absolutely has to work, you can rent services from Akamai, who have a huge and under-used network for exactly this service. Let them deal with distributing the load from one feed to thousands of servers worldwide: they think it will make them lots of money. They will play more clever DNS games than merely round-robining.
Third, forget streaming live if you can. Set up a download site for a Bittorrent feed. If lots of people want to see the download, let them distribute the load among themselves.
Fourth, forget streaming Windows Media. Use Quicktime or Real if you have to stream: they both put much less load on your servers and your server can handle a lot more clients.
Contact the folks at Carnegie Mellon University's "End System Multicast" gang. Its a P2P video streaming sysytem!
It's at http://esm.cs.cmu.edu/