Perlbal and MogileFS

Mark Smith smitty at gmail.com
Thu Nov 1 12:04:13 UTC 2007


>
> I've set up Perlbal to do the re-proxying for my MogileFS (store images).
> I'd like to set up some sort of caching though, so that the tracker doesn't
> have to hit the database with every request.
>
> Can my existing install of Perlbal help with this?  Perhaps through
> Memcached lookups so that image requests go from:
>
> user <-> perlbal <-> app <-> tracker <-> db <-> tracker <-> app <->
> perlbal <-> image server <-> perlbal <-> user
>
> To:
>
> user <-> perbal <-> memcache (or whatever) <-> image server <->
> perlbal <-> user
>

Yep, look at setting the reproxy_cache_maxsize value on the service.  This
will tell Perlbal to start caching these reproxy URLs which changes the path
to skip the entire backend application hit and jump straight to the location
that contains the resource.

On top of that, your application must return a new header when it returns
X-REPROXY-URL, this new header is of the form:

X-REPROXY-CACHE-FOR: <time>;<header list>

Where time is some time in seconds to cache this for and the header list is
a space separated list of headers that should be saved and replayed when we
construct a response from the cache.  Headers you'll want to save are things
such as Content-Type, Last-Modified, etc.

With everything running, doing a "show service foo" will give you more
information and show you such things as the cache hit/miss rate, size, etc.


-- 
Mark Smith / xb95
smitty at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.danga.com/pipermail/perlbal/attachments/20071101/75005607/attachment.html


More information about the perlbal mailing list