On Thursday 20 November 2003 7:15 pm, Matthew Smith wrote: > > From: "Ken Burcham" <[EMAIL PROTECTED]> > > > > can I do that lookup just once > > and stuff it somewhere like an application server variable? > > I use Apache::AxKit::Plugin::Session, there is a 'Global' taglib that > let's you share data between all instances of apache. It's a bit > involved though, if you're not doing access and authentication it might > be easier to directly use Apache::Session, there is a shared memory > module which would do the job. Maybe others have recomendations on the > best way to access shared memory for mod_perl.
The problem is that you have to have a backing store for your session data, which usually is an SQL database itself... Thus you would be caching your objects in a database, so why bother? I believe there is an implementation of an Apache::Session storage module that uses shared memory, but remember that shared memory is NOT without a cost! In fact in my testing I discovered that for most applications overall performance is best when you just let the objects live in MySQL. Remember, MySQL has a pretty good query cache, so in effect the database server is doing the caching, and if you think about it if you can afford to dedicate the memory to a cache, it doesn't matter which application does the caching. The only downside is the cost of serialization/deserialization and moving the data around. > > > where does this cache > > > > live? Or does it? > > My understanding is that it is stored in the memory of the perl instance > that is running. I also understand that there is a perl instance for > each apache server instance running - so things can get out of sync if > your browser comes in on a different server - hence the need for a > shared memory storage. > > matt > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- Tod Harter Giant Electronic Brain http://www.giantelectronicbrain.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
