You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Jonathan Vanasco <jo...@2xlp.com> on 2006/08/12 08:08:36 UTC

apache2::Status & B::TerseSize

i'm still trying to figure out how i have a 30mb parent and 17mb  
children

Apache2::Status is confusing me

"""
A very common setup might be: Perl Module B::TerseSize

   <Location /perl-status>
       SetHandler perl-script
       PerlResponseHandler Apache2::Status
       PerlSetVar StatusOptionsAll On
       PerlSetVar StatusDeparseOptions "-p -sC"
   </Location>

"""

So I tried this:

	PerlModule B::TerseSize
	<Location /perl-status>
       SetHandler perl-script
       PerlResponseHandler Apache2::Status
       PerlSetVar StatusOptionsAll On
       PerlSetVar StatusDeparseOptions "-p -sC"
       PerlSetVar Dot "/opt/local/bin/dot"
       PerlSetVar GraphDir "/webserver/tmp/"
	</Location>

I get this error
	Can't locate object method "menu_item" via package "Apache2::Status"  
at /Library/Perl/5.8.6/darwin-thread-multi-2level/B/TerseSize.pm line  
655.\nCompilation failed in require at (eval 192) line 3.\n
[Sat Aug 12 02:07:25 2006] [error] Can't load Perl module  
B::TerseSize for server (null):7081, exiting...

So then i eleminate loading B::TerseSize first.  It works ok, but I  
don't get memory performance for 'folders'

anyone have a clue?

Error with B::TerseSize WAS: apache2::Status & B::TerseSize

Posted by Jens Gassmann <je...@atomix.de>.
Hi Philip

> I assume you have the latest B-Size module installed (included TerseSize) 0.08 ?

After the reading about the Apache::Status-Moduls, i give it a try. But 
the interessing links fails :-(

Here the first information about the error, maybe you have an idea where 
i could start the debugging:

Can't locate object method "PRINTF" via package "B::Graph" at 
/usr/lib/perl5/site_perl/5.8.8/i686-linux/B/TerseSize.pm line 367.\n, 
referer: 
http://test.internal/perl-status///CMS3::Base::xmldata/FUNCTION?cv_dump


DOCUMENT_ROOT = /www/www.nak-koeln.de/html/
GATEWAY_INTERFACE = CGI/1.1
HTTP_ACCEPT = 
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
HTTP_ACCEPT_CHARSET = ISO-8859-1,utf-8;q=0.7,*;q=0.7
HTTP_ACCEPT_ENCODING = gzip,deflate
HTTP_ACCEPT_LANGUAGE = de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
HTTP_CONNECTION = keep-alive
HTTP_HOST = nak2004.internal
HTTP_KEEP_ALIVE = 300
HTTP_REFERER = http://nak2004.internal/perl-status//
HTTP_USER_AGENT = Mozilla/5.0 (Windows; U; Windows NT 5.1; de; 
rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6
MOD_PERL = mod_perl/2.0.2
MOD_PERL_API_VERSION = 2
PATH = 
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/opt/blackdown-jdk-1.4.2.03/bin:/opt/blackdown-jdk-1.4.2.03/jre/bin:/usr/kde/3.5/sbin:/usr/kde/3.5/bin:/usr/qt/3/bin:/opt/vmware/server/bin
PATH_INFO = /
PATH_TRANSLATED = /www/www.nak-koeln.de/html/
QUERY_STRING = env
REMOTE_ADDR = 192.168.1.2
REMOTE_PORT = 1319
REQUEST_METHOD = GET
REQUEST_URI = /perl-status//?env
SCRIPT_FILENAME = /www/www.nak-koeln.de/html/perl-status
SCRIPT_NAME = /perl-status
SERVER_ADDR = 192.168.1.1
SERVER_ADMIN = root@localhost
SERVER_NAME = nak2004.internal
SERVER_PORT = 80
SERVER_PROTOCOL = HTTP/1.1


> B		1.09_01	Mon Jul 24 07:34:12 2006	/usr/lib/perl5/5.8.8/i686-linux/B.pm
> B::Asmdata	1.01	Mon Jul 24 07:34:12 2006	/usr/lib/perl5/5.8.8/i686-linux/B/Asmdata.pm
> B::Concise	0.66	Mon Jul 24 07:34:12 2006	/usr/lib/perl5/5.8.8/i686-linux/B/Concise.pm
> B::Deparse	0.71	Mon Jul 24 07:34:12 2006	/usr/lib/perl5/5.8.8/i686-linux/B/Deparse.pm
> B::Fathom	0.07	Fri Sep 8 15:23:35 2000		/usr/lib/perl5/site_perl/5.8.8/B/Fathom.pm
> B::Graph	0.51	Mon Jan 1 04:51:11 2001		/usr/lib/perl5/site_perl/5.8.8/B/Graph.pm
> B::LexInfo	0.02	Tue Jun 29 06:44:50 1999	/usr/lib/perl5/site_perl/5.8.8/i686-linux/B/LexInfo.pm
> B::Size	0.08	Mon May 29 12:46:05 2006	/usr/lib/perl5/site_perl/5.8.8/i686-linux/B/Size.pm
> B::Terse	1.03_01	Mon Jul 24 07:34:12 2006	/usr/lib/perl5/5.8.8/i686-linux/B/Terse.pm
> B::TerseSize	0.08	Mon May 29 12:46:05 2006	/usr/lib/perl5/site_perl/5.8.8/i686-linux/B/TerseSize.pm
> B::Xref	1.01	Mon Jul 24 07:34:12 2006	/usr/lib/perl5/5.8.8/i686-linux/B/Xref.pm

Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
   Platform:
     osname=linux, osvers=2.6.16.26-xen, archname=i686-linux
     uname='linux egon 2.6.16.26-xen #1 smp mon jul 24 06:22:49 cest 
2006 i686 amd athlon(tm) 64 x2 dual core processor 3800+ authenticamd 
gnulinux '
     config_args='-des -Darchname=i686-linux -Dcccdlflags=-fPIC 
-Dccdlflags=-rdynamic -Dcc=i686-pc-linux-gnu-gcc -Dprefix=/usr 
-Dvendorprefix=/usr -Dsiteprefix=/usr -Dlocincpth=  -Doptimize=-O2 
-march=athlon-xp -pipe -mno-tls-direct-seg-refs -Duselargefiles 
-Dd_semctl_semun -Dscriptdir=/usr/bin -Dman1dir=/usr/share/man/man1 
-Dman3dir=/usr/share/man/man3 -Dinstallman1dir=/usr/share/man/man1 
-Dinstallman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3pm 
-Dinc_version_list=5.8.0 5.8.0/i686-linux 5.8.2 5.8.2/i686-linux 5.8.4 
5.8.4/i686-linux 5.8.5 5.8.5/i686-linux 5.8.6 5.8.6/i686-linux 5.8.7 
5.8.7/i686-linux  -Dcf_by=Gentoo -Ud_csh -Dusenm -Di_ndbm -Di_gdbm -Di_db'
     hint=recommended, useposix=true, d_sigaction=define
     usethreads=undef use5005threads=undef useithreads=undef 
usemultiplicity=undef
     useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
     use64bitint=undef use64bitall=undef uselongdouble=undef
     usemymalloc=n, bincompat5005=undef
   Compiler:
     cc='i686-pc-linux-gnu-gcc', ccflags ='-fno-strict-aliasing -pipe 
-Wdeclaration-after-statement -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
-I/usr/include/gdbm',
     optimize='-O2 -march=athlon-xp -pipe -mno-tls-direct-seg-refs',
     cppflags='-fno-strict-aliasing -pipe -Wdeclaration-after-statement 
-I/usr/include/gdbm'
     ccversion='', gccversion='4.1.1 (Gentoo 4.1.1)', gccosandvers=''
     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
     d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
     ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', 
lseeksize=8
     alignbytes=4, prototype=define
   Linker and Libraries:
     ld='i686-pc-linux-gnu-gcc', ldflags =' -L/usr/local/lib'
     libpth=/usr/local/lib /lib /usr/lib
     libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
     perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
     libc=/lib/libc-2.4.so, so=so, useshrplib=false, libperl=libperl.a
     gnulibc_version='2.4'
   Dynamic Linking:
     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
     cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl):
   Compile-time options: PERL_MALLOC_WRAP USE_LARGE_FILES USE_PERLIO
   Built under linux
   Compiled at Jul 24 2006 07:29:46
   @INC:
     /etc/perl
     /usr/lib/perl5/vendor_perl/5.8.8/i686-linux
     /usr/lib/perl5/vendor_perl/5.8.8
     /usr/lib/perl5/vendor_perl
     /usr/lib/perl5/site_perl/5.8.8/i686-linux
     /usr/lib/perl5/site_perl/5.8.8
     /usr/lib/perl5/site_perl
     /usr/lib/perl5/5.8.8/i686-linux
     /usr/lib/perl5/5.8.8
     /usr/local/lib/site_perl

Re: apache2::Status & B::TerseSize

Posted by Jonathan <jv...@2xlp.com>.
ok, also found

I also figured this out:

in B::TerseSize, line 634

- my $script = $q->script_name;

+ my 	$script ;
+ if ( defined $q && $q )
+ {
+ 	$script = $q->script_name;
+ }

Killing that makes a lot more things work too.

The only caveat of that, is that 'memory usage' doesn't appear on / 
perl-status/ until you visit a symdump page that contains memory- 
usage.  i don't know why.  but that should only happen on situations  
already afflicted by the other bug.  so its a stupid new bug instead  
of a bad old one.



Re: apache2::Status & B::TerseSize

Posted by Jonathan <mo...@2xlp.com>.

I'm finding some issues with the 2 modules

i think some of it happens when you have a module that has no  
subroutines ( ie , a namespace placeholder or something )

check out ~ line 551 in Apache2::Status

adding a few over-the-top checks seems to help, and gets memory use  
working on more items

     } (sort { $subs->{$b}->{size} <=> $subs->{$a}->{size} } keys % 
$subs);

+	return if ! scalar @keys;
+	return if ! defined $subs->{$keys[0]};
+	return if ! defined $subs->{$keys[0]}->{count};
+	return if ! defined $subs->{$keys[0]}->{size};

     my $clen = length $subs->{$keys[0]}->{count};
     my $slen = length $subs->{$keys[0]}->{size};


i'll have more fixes as time progresses

Re: apache2::Status & B::TerseSize

Posted by Jonathan <mo...@2xlp.com>.
On Aug 12, 2006, at 2:16 AM, Philip M. Gollucci wrote:

> I generally just do this:
> <Location /perl-status>
>   SetHandler perl-script
>   PerlResponseHandler Apache2::Status
>   PerlSetVar StatusOptionsAll On
>   PerlSetVar StatusDeparseOptions "-p -sC"
> </Location>
>
> which is what you wrote.

when you do that, do memory  stats work for the 'front page' and top  
levels?  they don't for me, but the do for everything else.

the docs suggest tossing a
	PerlModule B::TerseSize
before the block.  if you do, thats when the error happens.  has  
nothing to do with graphvis



Re: apache2::Status & B::TerseSize

Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
Jonathan Vanasco wrote:
> i'm still trying to figure out how i have a 30mb parent and 17mb children
I generally just do this:
<Location /perl-status>
  SetHandler perl-script
  PerlResponseHandler Apache2::Status
  PerlSetVar StatusOptionsAll On
  PerlSetVar StatusDeparseOptions "-p -sC"
</Location>

which is what you wrote.

I assume you have the latest B-Size module installed (included TerseSize) 0.08 ?
> I get this error
>     Can't locate object method "menu_item" via package "Apache2::Status"
> at /Library/Perl/5.8.6/darwin-thread-multi-2level/B/TerseSize.pm line
> 655.\nCompilation failed in require at (eval 192) line 3.\n
> [Sat Aug 12 02:07:25 2006] [error] Can't load Perl module B::TerseSize
> for server (null):7081, exiting...
> 
I don't think I've tried graphviz recently, I'll give it a whirl -- might not be soon ... company comming
this week.

-- 
------------------------------------------------------------------------
Philip M. Gollucci (pgollucci@p6m7g8.com) 323.219.4708
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com
1024D/A79997FA F357 0FDD 2301 6296 690F  6A47 D55A 7172 A799 97F

"In all that I've done wrong I know I must have done something right to
deserve a hug every morning and butterfly kisses at night."
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /
 / /|_/ / // /\ \/ /_/ / /__
/_/  /_/\_, /___/\___\_\___/
       <___/