You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Lester Vecsey <bl...@optonline.net> on 2004/03/20 01:54:24 UTC

CDB_File

I'm serving many web requests with an apache modperl handler, and I'm doing
lookups on a CDB_File within the handler, using 'tie' to open the cdb file
for every request that comes through. Is there a way to gain more
performance by somehow doing a tie/open just once when the apache servers
starts, and then again only when the cdb file changes, if needed?


-- 
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


Re: CDB_File

Posted by Matt Sergeant <ma...@sergeant.org>.
On 20 Mar 2004, at 07:54, David Hodgkinson wrote:

> On 20 Mar 2004, at 0:54, Lester Vecsey wrote:
>
>> I'm serving many web requests with an apache modperl handler, and I'm 
>> doing
>> lookups on a CDB_File within the handler, using 'tie' to open the cdb 
>> file
>> for every request that comes through. Is there a way to gain more
>> performance by somehow doing a tie/open just once when the apache 
>> servers
>> starts, and then again only when the cdb file changes, if needed?
>
> Exactly what you just said. Open read-only though! You'll probably
> need a 'use vars' in startup.pl to make the handle global.

CDB's are read only anyway, so this shouldn't make a difference.

I'm not convinced this is a good place to look for performance gains 
though. The tie process for a cdb is just a file open.

Matt.


-- 
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


Re: CDB_File

Posted by David Hodgkinson <da...@hodgkinson.org>.
On 20 Mar 2004, at 0:54, Lester Vecsey wrote:

> I'm serving many web requests with an apache modperl handler, and I'm 
> doing
> lookups on a CDB_File within the handler, using 'tie' to open the cdb 
> file
> for every request that comes through. Is there a way to gain more
> performance by somehow doing a tie/open just once when the apache 
> servers
> starts, and then again only when the cdb file changes, if needed?


Exactly what you just said. Open read-only though! You'll probably
need a 'use vars' in startup.pl to make the handle global.


-- 
Dave Hodgkinson
CTO, Rockit Factory Ltd.
http://www.rockitfactory.com/
Web sites for rock bands


-- 
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