request - help with streaming flash video through perlbal

Eric Lambrecht eml at
Sun Nov 25 18:29:17 UTC 2007

EJH Pollard wrote:
> In other words, an HTTP GET request to the perlbal server for
> would be handled by 1) perlbal
> sends the 13 byte FLV header to the client, 2) perlbal does an HTTP
> GET request to with a "Range:
> xxxx" header, and then streams the output from S3 to the client.  For
> extra bonus points, rate-limited to 35kbps, to save us some money on
> uncessary downloads of the whole FLV file (it plays out 33kbps, and we
> don't need to seek ahead and fill up the cache).
> Is it possible to configure perlbal, patched as per
>, to
> behave in the manner described above?  If not, do you have any
> suggestions for what I should do to the patch/config to make it work
> like that?  We have a modest budget, and if it's a lot of work then I

Hi Etienne -
  I believe the patch I submitted will do what you want, but you're 
missing one component.

In your email the perlbal server recognizes the '?start=xxx' request 
parameters, makes a modified response to the S3 storage server, and 
proxies the file out to the client.

My patch doesn't put any smarts into perlbal - it assumes that you've 
got another web server that is interpreting the incoming request, 
mapping it to a location in S3 (or mogile), and telling perlbal where to 
get that final file and to also include that magic 13 byte header.

To make things work with my patch, you need to first set up perlbal to 
reproxy all requests to some webserver you've got running on the same 

Then let's assume your requests for flash files all look like this:

	GET /play?id=123123&start=5675675

Where 'id' is the id of the flash file, and 'start' is the byte offset 
for the FLV file.

The '/play' cgi script on your webserver should map the value of 'id' to 
the location of your flash file in S3 (lets say that is 
''), and send these headers back to perlbal:


perlbal will then close the connection to the webserver, open a 
connection to S3, jump to byte offset 5675675, send the 13 byte magic 
header to the client, then send the remainder of the flv file to the client.

So the only real development you need to do is to create that cgi script 
that generates those headers, which should be pretty easy.


More information about the mogilefs mailing list