filename - hashkey

Mark Smith smitty at gmail.com
Thu Jan 10 03:01:52 UTC 2008


> > The web site should have some logic here.  If you use Perlbal in front
> > then the amount of logic you have to write is vanishingly small.  Look
> > it up, return it.  Then configure Perlbal to do reproxying and caching
> > and you don't really have to worry about anything.
> >
> How do i setup perlbal to do this for me?
> Or do i have to parse each file through perl/php to translate
> http://domain.com/user/foto/6143.jpg to
> http://10.0.0.102/dev1/0/000/0000012.fid
> for example?

Well, Perlbal doesn't translate the URL for you.  That has to be done
by either a custom plugin you write for Perlbal, or by your
application.  Both approaches work.

1) user requests http://domain.com/user/foto/6143.jpg
2) Perlbal sends request to Apache
3) Apache (with Perl/PHP/Python/whatever) returns X-REPROXY-URL:
http://10.0.0.102/dev1/0/012.fid
4) Perlbal connects to Mogstored
5) Perlbal returns file to the user

You can turn on caching in Perlbal too, so it only hits your
application every once in a while and will then cache the Mogile
paths.  This makes it fairly efficient for popular files.

If you write a plugin for Perlbal to do the Mogile lookup, then you
can avoid having an application server and do everything in Perlbal.
I think someone has written plugins like this, but I'm not entirely
sure.

> I haven't found any documentation about this usage anywhere! :(

Documentation is quite sparse.  I keep meaning to write some, never
think about it when I'm looking for things to do...


-- 
Mark Smith / xb95
smitty at gmail.com


More information about the perlbal mailing list