You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Brian Akins <br...@turner.com> on 2006/05/03 21:44:27 UTC

Generic cache architecture

Is anyone else interested in having a generic cache architecture?  (not 
http).  I have plenty of cases were I re-invent the wheel for caching 
various things (IP's, sessions, whatever, etc.).  It would be nice to 
have a provider based architecture for such things.



-- 
Brian Akins
Lead Systems Engineer
CNN Internet Technologies

Re: Generic cache architecture

Posted by Nick Kew <ni...@webthing.com>.
On Wednesday 03 May 2006 20:44, Brian Akins wrote:
> Is anyone else interested in having a generic cache architecture?  (not
> http).  I have plenty of cases were I re-invent the wheel for caching
> various things (IP's, sessions, whatever, etc.).  It would be nice to
> have a provider based architecture for such things.

Yes, I think at that basic level, your proposal is uncontroversial.
I'd like to be able to plug in alternative cacheing modules without
having to reimplement the whole thing.

I would point out there's a big "grey area" here, with regimes
such as ESI cacheing that are bastardised HTTP.  mod_cache_http
is (modulo any bugs) technically accurate for the current cache
module, but calling it mod_cache_rfc2616 might be less confusing
for users of other cacheing regimes that purport to be HTTP
(like ESI), or that run *on top of* HTTP (like some XML-based
monstrosities).

-- 
Nick Kew

Re: Generic cache architecture

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Gonzalo Arana wrote:
> On 5/3/06, Brian Akins <br...@turner.com> wrote:
> 
>> Is anyone else interested in having a generic cache architecture?  (not
>> http).  I have plenty of cases were I re-invent the wheel for caching
>> various things (IP's, sessions, whatever, etc.).  It would be nice to
>> have a provider based architecture for such things.
> 
> I am. How about adding it to apr?

1. this isn't the dev@apr list, so your inquiry is 1/2 off topic

2. apr isn't a dumping ground

3. however... to the extent that this really portably solves the backend
    storage problem through an array of different providers, that well fits
    into apr-util's mission.  A *vanilla* data store.  The caching mechanics
    of request bodies will always belong in httpd.

Re: Generic cache architecture

Posted by Brian Akins <br...@turner.com>.
Gonzalo Arana wrote:

> I am. How about adding it to apr?

How about someone figuring out how to get providers into apr?  Doesn't 
look horribly hard.  Perhaps I should ask on apr-devel?


-- 
Brian Akins
Lead Systems Engineer
CNN Internet Technologies

Re: Generic cache architecture

Posted by Gonzalo Arana <go...@gmail.com>.
On 5/3/06, Brian Akins <br...@turner.com> wrote:
> Is anyone else interested in having a generic cache architecture?  (not
> http).  I have plenty of cases were I re-invent the wheel for caching
> various things (IP's, sessions, whatever, etc.).  It would be nice to
> have a provider based architecture for such things.

I am. How about adding it to apr?

Regards,

--
Gonzalo A. Arana

Re: Generic cache architecture

Posted by Gonzalo Arana <go...@gmail.com>.
> >
> > Let's talk about httpd.  We have a cache of ssl sessions.  We have
> > a cache
> > of httpd response bodies.  We have a cache of ldap credentials.  A
> > really
> > thorough mod_usertrack would have a cache of user sessions.
> >
> > So really, it doesn't make sense to have these four wheels spinning
> > out of
> > sync at different stages of stability and performance.  I'm
> > strongly +1 to
> > provide this functionality once, and reuse.
>
> On the contrary, it makes no sense whatsoever to use a generic
> storage facility for cached HTTP responses in a front-end cache
> because those responses can only be delivered at maximum speed
> through a single system call IFF they are not generic.  That is
> why our front-end cache is not, and has never needed to be, a
> generic cache.

I have to disagree: indeed a single syscall implies maximum speed &
minimum memcpy (kernel to user, user to kernel), but consider that a
cached response perhaps needs to get compressed (Transfer-Encoding:
gzip, for instance).  So, there is no way to assure that a single
syscall will work.

A generic cache, if designed with propper care, could provide a
filedescriptor, which can be used with sendfile(2) or
mmap(2)/write(2)/munmap(2) or any other combination.

> A front-end cache is a completely different beast from a
> back-end cache.  It doesn't make any sense to me to try to

what do you mean by 'front end cache' and 'backend cache'?

> make them the same, and it certainly isn't elegant.  SSL
> session, ldap credentials, sessions, and all those related
> things are trivial memory blocks that *are* suitable for
> back-end caching.

> I have no objection to creating a module for back-end caching.
> I have no objection to creating five different forms of caching
> modules, each with its own qualities, that can be selected by
> configuration (preferably based on some suggested site profile).

perhaps each kind of cache could be used by different parts (SSL
session, ldap credentials, session, would use the 'backend cache'),
and HTTP would use 'front-end cache'.

> However, I see no reason to start by changing the existing
> module names and assuming that one cache fits all.

Regards,

--
Gonzalo A. Arana

Re: Generic cache architecture

Posted by Ruediger Pluem <rp...@apache.org>.

On 05/04/2006 12:35 AM, Justin Erenkrantz wrote:

> 
> For simplicity sake, I agree.  Let's call this new thing
> mod_cache_generic or mod_frobit.  However, let's not touch mod_cache
> and friends for now.
> 
> We can rearrange things later if this new "architecture" actually has
> any benefits.  I am concerned that overgeneralization is going to make
> things slower.  So, I'd prefer to see us remove code rather than add;
> but to also do it in parallel.  So, I'd like to defer touching
> mod_cache until we know we have something that is concretely better. --

+1. First have a working alternative to the current code and toss the current code
if the new one is better (whatever better means by then exactly).


Regards

Rüdiger


Re: Generic cache architecture

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
On 5/3/06, Roy T. Fielding <fi...@gbiv.com> wrote:
> However, I see no reason to start by changing the existing
> module names and assuming that one cache fits all.

For simplicity sake, I agree.  Let's call this new thing
mod_cache_generic or mod_frobit.  However, let's not touch mod_cache
and friends for now.

We can rearrange things later if this new "architecture" actually has
any benefits.  I am concerned that overgeneralization is going to make
things slower.  So, I'd prefer to see us remove code rather than add;
but to also do it in parallel.  So, I'd like to defer touching
mod_cache until we know we have something that is concretely better. 
-- justin

Re: Generic cache architecture

Posted by Brian Akins <br...@turner.com>.
Roy T. Fielding wrote:
  > provide this functionality once, and reuse
> On the contrary, it makes no sense whatsoever to use a generic
> storage facility for cached HTTP responses in a front-end cache
> because those responses can only be delivered at maximum speed
> through a single system call IFF they are not generic.  That is
> why our front-end cache is not, and has never needed to be, a
> generic cache.

a generic cache can deliver objects in a single system call.  Thinks 
VFS.  the "generic storage facility" may be only a thin wrapper around 
something like current mod_disk_cache or it may be a memcache frontend, 
or something completely different.

Trust me, I am extremely concerned about performance.




-- 
Brian Akins
Lead Systems Engineer
CNN Internet Technologies

Re: Generic cache architecture

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Roy T. Fielding wrote:
> 
> A front-end cache is a completely different beast from a
> back-end cache.  It doesn't make any sense to me to try to
> make them the same, and it certainly isn't elegant.  SSL
> session, ldap credentials, sessions, and all those related
> things are trivial memory blocks that *are* suitable for
> back-end caching.

/nod - I can appreciate the distinction.  That said, the we will be better
for grouping front end cache providers together, with one solid reference
implementation (play your optimization games in experimental providers),
and likewise a framework for the back end cache providers with one solid
reference implementation, and I suspect httpd gets a whole lot more simple
and stable with these available to third party authors.

Bill

Re: Generic cache architecture

Posted by "Roy T. Fielding" <fi...@gbiv.com>.
On May 3, 2006, at 12:53 PM, William A. Rowe, Jr. wrote:

> Brian Akins wrote:
>> Is anyone else interested in having a generic cache architecture?   
>> (not http).  I have plenty of cases were I re-invent the wheel for  
>> caching various things (IP's, sessions, whatever, etc.).  It would  
>> be nice to have a provider based architecture for such things.
>
> Let's talk about httpd.  We have a cache of ssl sessions.  We have  
> a cache
> of httpd response bodies.  We have a cache of ldap credentials.  A  
> really
> thorough mod_usertrack would have a cache of user sessions.
>
> So really, it doesn't make sense to have these four wheels spinning  
> out of
> sync at different stages of stability and performance.  I'm  
> strongly +1 to
> provide this functionality once, and reuse.

On the contrary, it makes no sense whatsoever to use a generic
storage facility for cached HTTP responses in a front-end cache
because those responses can only be delivered at maximum speed
through a single system call IFF they are not generic.  That is
why our front-end cache is not, and has never needed to be, a
generic cache.

A front-end cache is a completely different beast from a
back-end cache.  It doesn't make any sense to me to try to
make them the same, and it certainly isn't elegant.  SSL
session, ldap credentials, sessions, and all those related
things are trivial memory blocks that *are* suitable for
back-end caching.

I have no objection to creating a module for back-end caching.
I have no objection to creating five different forms of caching
modules, each with its own qualities, that can be selected by
configuration (preferably based on some suggested site profile).
However, I see no reason to start by changing the existing
module names and assuming that one cache fits all.

....Roy

Re: Generic cache architecture

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Ruediger Pluem wrote:
> 
> On 05/03/2006 11:27 PM, William A. Rowe, Jr. wrote:
>>Moreso, we need more third party authors to -participate- in telling us what
>>in HTTPD-2.4 will make their module better.  And a faster cycle of 6mos-1yr
>>gives them a chance to do this and realize the benefits in the official
>>release more quickly.
> 
> But some of them will fall off the shelf (I guess especially some commercial
> ones), because they do not want to invest time again into an changing API.

Of course.  Why stall all efforts because some don't move with new technologies?

> This means that they stick with an older version and do not do releases for
> each major version, but lets say for every second.

Ok, their user's loss, not an httpd development issue.

Let's be clear here, this isn't a statement against making their lives easier
to actually do the ports - we could be a heck of a lot more helpful in module
authoring and especially in porting documetation.

> Furthermore having frequent major releases increases the backport requests from
> user side and thus likely the backport efforts, as some users stick with older
> versions for whatever reasons (e.g. third party modules).

Wrong.  We honor fewer backport requests for features.  We might entertain some
for bug fixes certainly.  But the answer's always upgrade asap for fixes, and
an upgrade's manditory for new features.

Backporting features is a vicious cycle.  No problem here with folks using
Apache 1.3 when it solves their pain.  But if they want cool feature X and
we give it to them, we support 1.3 for that much longer because this-bug
and that-bug aught to get fixed, and new feature X has a bug so we have
a subsequent release, followed by 12 more pleas for other features to be
backported.

Nip it in the bud, freeze the features in old version, and poof, people move
because they *want* the new features, it solves more of their pain, and so they
have an incentive to make *their* investment of time in migrating.  Take away
the incentive and they will not (heck, should not) migrate up to our supported
version.

> Maybe we should have a FDT (Frequently Discussed Topics) to collect the arguments ;-).

Hehe.

Re: Generic cache architecture

Posted by Ruediger Pluem <rp...@apache.org>.

On 05/03/2006 11:27 PM, William A. Rowe, Jr. wrote:

> 
> Moreso, we need more third party authors to -participate- in telling us
> what
> in HTTPD-2.4 will make their module better.  And a faster cycle of 6mos-1yr
> gives them a chance to do this and realize the benefits in the official
> release more quickly.

But some of them will fall off the shelf (I guess especially some commercial
ones), because they do not want to invest time again into an changing API.
This means that they stick with an older version and do not do releases for
each major version, but lets say for every second.
Furthermore having frequent major releases increases the backport requests from
user side and thus likely the backport efforts, as some users stick with older
versions for whatever reasons (e.g. third party modules).
I know we had this discussion about major release cycles several times in the past.
Both approaches have pros and cons. So each side can dig out its old arguments / mails
as I do not think that something essential new has been added to the pros and cons
since last time :-).
Maybe we should have a FDT (Frequently Discussed Topics) to collect the arguments ;-).

> 
> Note that 2.2 will be a year old by December, so even if this concerns you,
> we are already half way there.

One for you. In 5 month httpd 2.2 is not far away from its first birthday.
I hate infant mortality :-).


Regards

Rüdiger


Re: Generic cache architecture

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Graham Leggett wrote:
> Ruediger Pluem wrote:
> 
>> Please keep in mind that some of us are dependent on commercial httpd 
>> modules,
>> whether we like it or not.
>> If the major upgrades happen in cyles shorter than a year I guess it is
>> hard to get the commercial vendors to provide them. Not everybody is that
>> innovative and fast as the ASF :-).
> 
> +1.

-0.  You forget that we were frequently breaking the API way-way-back-when,
and the good vendors kept up, and the lousy ones didn't.

Moreso, we need more third party authors to -participate- in telling us what
in HTTPD-2.4 will make their module better.  And a faster cycle of 6mos-1yr
gives them a chance to do this and realize the benefits in the official
release more quickly.

Note that 2.2 will be a year old by December, so even if this concerns you,
we are already half way there.

Bill

Re: Generic cache architecture

Posted by Graham Leggett <mi...@sharp.fm>.
Ruediger Pluem wrote:

> Please keep in mind that some of us are dependent on commercial httpd modules,
> whether we like it or not.
> If the major upgrades happen in cyles shorter than a year I guess it is
> hard to get the commercial vendors to provide them. Not everybody is that
> innovative and fast as the ASF :-).

+1.

Regards,
Graham
--

Re: Generic cache architecture

Posted by Ruediger Pluem <rp...@apache.org>.

On 05/03/2006 09:53 PM, William A. Rowe, Jr. wrote:

> 
> And finally (most important) none of this needs to target 2.2.  If 2.2
> lives
> 5 months to be replaced by 2.4 - there is really no issue.  2.0 lived

Please keep in mind that some of us are dependent on commercial httpd modules,
whether we like it or not.
If the major upgrades happen in cyles shorter than a year I guess it is
hard to get the commercial vendors to provide them. Not everybody is that
innovative and fast as the ASF :-).

Regards

Rüdiger

Re: Generic cache architecture

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Brian Akins wrote:
> Is anyone else interested in having a generic cache architecture?  (not 
> http).  I have plenty of cases were I re-invent the wheel for caching 
> various things (IP's, sessions, whatever, etc.).  It would be nice to 
> have a provider based architecture for such things.

Let's talk about httpd.  We have a cache of ssl sessions.  We have a cache
of httpd response bodies.  We have a cache of ldap credentials.  A really
thorough mod_usertrack would have a cache of user sessions.

So really, it doesn't make sense to have these four wheels spinning out of
sync at different stages of stability and performance.  I'm strongly +1 to
provide this functionality once, and reuse.

While we are at it, the proxy backend requester should be generic enough that
if I need to fetch, say, a trusted CA reference from a backend (dmz) server,
that code shouldn't be rewritten either.  But it's not oriented to the request
so it would be good to see some more modularity on the proxy backend while we
improve the cache middle layer.

And finally (most important) none of this needs to target 2.2.  If 2.2 lives
5 months to be replaced by 2.4 - there is really no issue.  2.0 lived too long
because 2.1.x stayed in flux to long.

Bill