Downloading video from a web server
July 5, 2007 12:10 PM Subscribe
Say I have a video I want to put on my website. It's 10MB. I use Flash video for progressive download. Ignoring bandwidth issues, what are the implications for my web server if lots of people want to watch it at the same time, and what steps can I take to ensure everything runs smoothly?
I'm actually already doing this, and so far haven't had any issues. But what happens if 10 people want to watch the same video simultaneously? Or 100? Or even more? Will this kill my server? I assume there is some calculation I can do which will tell me what kind of server I need to buy. So how do I work out the minimum spec I need to get by, and the maximum which gives me lots of room to grow?
(I'm looking at hosting with YouTube or whatever instead, but it might not be an option.)
I'm actually already doing this, and so far haven't had any issues. But what happens if 10 people want to watch the same video simultaneously? Or 100? Or even more? Will this kill my server? I assume there is some calculation I can do which will tell me what kind of server I need to buy. So how do I work out the minimum spec I need to get by, and the maximum which gives me lots of room to grow?
(I'm looking at hosting with YouTube or whatever instead, but it might not be an option.)
Best answer: I don't know of a way to calculate it, but my gut feeling is that plain-old-Apache on a unix-clone on middle-of-the-road hardware would be able to handle a couple hundred simultaneous connections without breathing hard. There is probably specialized software for serving many copies (thousands) of the same large file efficiently. Once you reach tens of thousands of simultaneous connections you'll start to have problems because of the way tcp works. At that point, talk to Akamai or somebody.
Just now I fired off 100 simultaneous rate-limited 'curl' downloads of a 3MB file from the webserver on my 7-year-old bsd box (which was a pleasantly fast desktop machine when it was new, but nothing special) to my laptop. They all proceeded at speed and neither machine was noticeably loaded. My laptop didn't want to run more than 100 simultaneously though. If I don't rate-limit, it will happily saturate its local 100MB ethernet — the load average on the webserver gets up to around 0.9 or 1.0 then but it's still reasonably responsive.
Really, if you're just serving static files, bandwidth is your main concern. (On preview, what mkultra said.)
posted by hattifattener at 1:36 PM on July 5, 2007
Just now I fired off 100 simultaneous rate-limited 'curl' downloads of a 3MB file from the webserver on my 7-year-old bsd box (which was a pleasantly fast desktop machine when it was new, but nothing special) to my laptop. They all proceeded at speed and neither machine was noticeably loaded. My laptop didn't want to run more than 100 simultaneously though. If I don't rate-limit, it will happily saturate its local 100MB ethernet — the load average on the webserver gets up to around 0.9 or 1.0 then but it's still reasonably responsive.
Really, if you're just serving static files, bandwidth is your main concern. (On preview, what mkultra said.)
posted by hattifattener at 1:36 PM on July 5, 2007
Response by poster: Thanks. One further question. If I did use a server based video player (I have the option) would that make a big difference?
posted by zingzangzung at 1:56 PM on July 5, 2007
posted by zingzangzung at 1:56 PM on July 5, 2007
« Older help me bring down the man, one bike ticket at a... | Visiting Tulum, Mexico. Where should we stay? Newer »
This thread is closed to new comments.
Either way, as long as you're serving from a web server (as opposed to Flash Server, your overhead is really small. As long as you've got a decent (Gigabyte) ethernet connection and decent RAM, any web server can spit out the same 10MB file without breaking a sweat. It's really hard to overload a web server via multiple connections- generally you just set the max # of concurrent connections and everything beyond that gets queued.
If you're regularly getting 100+ simultaneous views, I'd go with a hosting company.
posted by mkultra at 12:52 PM on July 5, 2007