Re: Persisting data across authenticate <-> authorize ?

[prev] [thread] [next] [Date index for 2004/12/14]

From: Perrin Harkins
Subject: Re: Persisting data across authenticate <-> authorize ?
Date: 06:08 on 14 Dec 2004
On Mon, 2004-12-13 at 22:48 -0700, Tim Pushor wrote:
> Right - I scoured the Cache::FastmMap perldoc and didn't see any way to 
> do this.

You'd have to do it yourself with Cache::FastMmap, and check it on the
way out.  You might be better off using something else at that point.

Here are some performance comparisons, if you're interested:
http://cpan.robm.fastmail.fm/cache_perf.html

> Are you talking about the good ol' berk db (1.85) or the newer sleepycat 
> versions?

Definitely the Sleepycat ones!  I'm using 4.2.  This could make a huge
difference.

> So the first crack of the module there was significant lock contention - 
> as every access to every part of the site required an exclusive lock.

Page-level locking should certainly have helped with that.  More recent
versions of BerkeleyDB are so fast though, it really might not be
needed.

> When I was revamping the C module, I had considered 
> writing a threaded daemon that would keep track of the tokens in memory, 
> with a unix domain socket interface to the httpd processes. This has 
> lots of advantages but is complex.

Don't build your own, just use a local MySQL server.  That's exactly
what it does, and it's foolishly fast at simple primary key read/write
stuff over unix sockets.  It really does beat nearly all of the caching
modules on CPAN for speed when you use it for simple stuff.

> Yeah, I meant how the IPC::Shareable implements locking (well, 
> IPC::SysV) - I realize this is done in C.

Might be mmap'ed or semaphores.  I really have no idea for FreeBSD.

> I was planning on doing my own more efficent transformation to/from a 
> scalar, and telling IPC::Shareable to not bother serializing it

I've never tried that, but it sounds like an improvement.  Currently,
the more data you put into IPC::Shareable, the slower it goes.

- Perrin


        -- 
        Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

(message missing)

Re: Persisting data across authenticate <-> authorize ?
Perrin Harkins 06:08 on 14 Dec 2004

Generated at 11:26 on 21 Dec 2004 by mariachi v0.52