Mur has asked for the wisdom of the Perl Monks concerning the following question:

Somewhat of an emergency ... Our production server has developed a fascinating little error, running the same code as our test server (which, obviously, doesn't exhibit this error):
Apache::SharedMem object initialization: wrong root map type at /us r/local/lib/perl5/site_perl/5.8.3/Apache/SharedMem.pm line 972 (Carp:: +confess/115) Apache::SharedMem::_init_root('Apache::Cache=HASH(0x90676b4)') + called at /usr/local/lib/perl 5/site_perl/5.8.3/Apache/SharedMem.pm line 1068 Apache::SharedMem::_init_namespace('Apache::Cache=HASH(0x90676 +b4)') called at /usr/local/lib /perl5/site_perl/5.8.3/Apache/SharedMem.pm line 244 Apache::SharedMem::new('Apache::Cache','namespace','n_web') ca +lled at /usr/local/lib/perl5/s ite_perl/5.8.3/Apache/Cache.pm line 197
Any insights?
--
Jeff Boes
Database Engineer
Nexcerpt, Inc.
vox 269.226.9550 ext 24
fax 269.349.9076
 http://www.nexcerpt.com
...Nexcerpt...Connecting People With Expertise

Replies are listed 'Best First'.
Re: mod_perl, Apache::Cache problem
by perrin (Chancellor) on May 11, 2005 at 22:01 UTC
    Not that useful to you right now, but I would strongly suggest you stop using this module. It's incredibly slow. I would estimate that BerkeleyDB or Cache::FastMmap would be 100 or so times faster, based on benchmarks I've done in the past with IPC::ShareLite (which this uses).
Re: mod_perl, Apache::Cache problem
by Mur (Pilgrim) on May 25, 2005 at 12:43 UTC
    I thought I should update this based on what we learned post-mortem, in case anyone should stumble into this problem again: Our web server setup used to be on the same machine as the rest of the system. Then it moved to another machine, and we NFS-mounted the code base (read-only). Apparently, Apache::Cache creates some kind of temp file in a default location (apparently, because I haven't found the exact documentation of this and I'm guessing), which appears to be the same directory as the code which uses Apache::Cache. If it can't create this file, it chokes. The file remained there after we changed the directory to be read-only NFS-mounted (why it wasn't deleted when the web server exited, I dunno). Even though it was read-only, Apache::Cache was happy to see it, although it (apparently; boy, I hate having to use that word so much) never tried to write to it (which would have caused a different chokeage, I guess). As it turns out, we were rethinking our decision to use the NFS mount, because it meant our webserver would be unusable if the main machine had to go down. So we undid all that and use rsync to keep the source directory updated. Once we made the directory writeable, the problem vanished.
    --
    Jeff Boes
    Database Engineer
    Nexcerpt, Inc.
    vox 269.226.9550 ext 24
    fax 269.349.9076
     http://www.nexcerpt.com
    ...Nexcerpt...Connecting People With Expertise