Using Cache::Mmap in mod_perl
Has anyone tried using Cache::Mmap in mod_perl? I have some virtualhost related data I would like to share amoung the apache children, a quick lookup at cpan.org I find this Cache::Mmap module which seems to fits my need just right. I have written a perl code to test my design off apache, it works very well, performance is great too, but as soon as I move the code into mod_perl, the script fail and report in error log Can't locate auto/Cache/Mmap/read.al in @INC I have searched google and archieve of mod_perl and perl beginner list without finding any hints. anyone have a clue what I have missed? This is the version of software/library I am using Linux 2.4.26 perl 5.6.1 apahce 1.3.27 mod_perl 1.27 Cache::Mmap 0.81 Many thanks. Tor -- 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: Using Cache::Mmap in mod_perl
Hi Peter, Thanks for your promp reply, I have tried to reinstall Cache::Mmap via CPAN as you suggested, but doesn't seems to help, the error still show up. I am pitty sure the perl have not been changed after I installed mod_perl, but I will try recompile mod_perl tomorrow just to make sure. I might have a syntex problem before now I relocated the new statement which the code read something like this now. my $vhostcache = Cache::Mmap->new("/tmp/vhost.mmap", \%options); .. (bunch of codes) ($rv, $res) = $vhostcache->read($host); instead of read.al now it complain _lock.al Can't locate auto/Cache/Mmap/_lock.al in @INC anyways, maybe I should try reinstall mod_perl first and see if that fixes the problem. Many thanks. Tor. On Mon, 19 Jul 2004 11:59:45 +0100, Peter Haworth <[EMAIL PROTECTED]> wrote: > On Mon, 19 Jul 2004 11:57:56 +0800, Victor Tsang wrote: > > Has anyone tried using Cache::Mmap in mod_perl? > > That's what I wrote it for. My application uses Cache::Mmap to share > caches between apache children and other processes. > > > I have written a perl code to test my design off apache, it works > > very well, performance is great too, > > Glad to hear it. > > > but as soon as I move the code into mod_perl, the script fail and > > report in error log > > > > Can't locate auto/Cache/Mmap/read.al in @INC > > I'm having trouble seeing how this could occur with the module > correctly installed, since Cache::Mmap doesn't use AutoLoader > (although DynaLoader does pull it in). In any case, if new() is > defined (which is must be, since you're trying to call read()), then > read() ought to be, too. > > I suspect one of the following: > * your normal perl is different to your mod_perl perl, and the > Cache::Mmap installation in the mod_perl perl is broken > * you are calling Cache::Mmap::read() directly, and haven't loaded the > module. I can't imagine why you'd do this, though, and your non- > mod_perl version of this code wouldn't work, either. > > Check that the mod_perl copy of Cache::Mmap is installed correctly. > Use CPAN's "force install" option if necessary, and make sure that you > are using the perl appropriate to your mod_perl installation. > > -- >Peter Haworth [EMAIL PROTECTED] > "Do you count brain rot as a valid reason?" >-- Larry Wall > -- 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: Using Cache::Mmap in mod_perl
Hi Perrin, I have tired to look for the file along the @INC I managed to find the path but the directory is empty. I have taken a quick look into Cache::Mmap source and it doesn't appears to be using autoload, that Peter himself has confirmed. I am going to take Peter's suggestion to reinstall mod_perl today and see if that will fixes the problem. Many thanks. Tor. On Tue, 20 Jul 2004 11:53:27 -0400, Perrin Harkins <[EMAIL PROTECTED]> wrote: > On Tue, 2004-07-20 at 06:19, Victor Tsang wrote: > > Can't locate auto/Cache/Mmap/_lock.al in @INC > > You're having problems with autoloading. Check for the existence of > "auto/Cache/Mmap/_lock.al" on your system, and then check that its path > is in @INC when you run under mod_perl (command-line doesn't count) and > that the user you run mod_perl as can read it. I suspect you will find > a missing path or incorrect permissions somewhere. > > - 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
debuging run away httpd process
Hello everyone, This could be a bit off topic, please kindly forgive me if it is so, I am seeking for tips on debugging perl script that is running under mod_perl. We use mod_perl heavily here, and lately I notice some apache children for some reason chew up large amount of cpu (indeed all cpu). Using apache's server-status i can tell it is one of the new script we have deployed that caused the probloem, but trouble is, the script is big, where should I start looking. What I usually do is to use strace, lsof to see if I can get some hints as of what's the process is doing, but this time, running strace on the httpd process simply return nothing, and lsof doesn't offer much tips either. checking /proc//fd/ I found the process has opened some socket binding to some inode, I used netstat -nape to try to find what those inode were binded to, but I couldn't find anything. I think my senior has nailed the problem by reviewing the source, but I wonder if there's something I could have done more/better in analysing the problem. Is the method/tool chain I'm using appropiate? is there anything inside mod_perl I can turn on/off/tweak so I can get more knowledge of running mod_process? Any advice would be much appreicated. Tor. -- 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