You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by sm...@ChrBook.com on 2002/05/08 16:57:03 UTC

StatusTerseSizeMainSummary

Hi folks,

I'm trying to use /perl-status to do some analysis on my mod_perl server
(v.1.25). I'm trying to enable the top-level module memory usage summary as
described in the mod_perl cookbook.

I've tried putting the following two snippets into my httpd.conf (at
separate times).

<Location /perl-status>
SetHandler perl-script
PerlHandler Apache::Status
PerlSetVar StatusTerse On
PerlSetVar StatusTerseSize On
PerlSetVar StatusTerseSizeMainSummary On
PerlSetVar StatusDumper On
PerlSetVar StatusPeek On
order deny,allow
#deny from all
#allow from
</Location>

... and the second ...

<Location /perl-status>
SetHandler perl-script
PerlHandler Apache::Status
PerlSetVar StatusOptionsAll On
order deny,allow
#deny from all
#allow from
</Location>

Neither of these give me the "Memory Usage" link in the top level page that
the cookbook talks about.  (Other such links are present on module pages,
but not at the top level.)

Can anyone tell me what I'm missing here?

Thanks for your help.

- Simon

****************************************
Simon Miner
Web Developer
Christianbook.com

E: sminer@christianbook.com
T: 978-573-2233
F: 978-573-8233
****************************************


Re: StatusTerseSizeMainSummary

Posted by Paul Lindner <li...@inuus.com>.
On Wed, May 08, 2002 at 10:57:03AM -0400, sminer@ChrBook.com wrote:
> Hi folks,
> 
> I'm trying to use /perl-status to do some analysis on my mod_perl server
> (v.1.25). I'm trying to enable the top-level module memory usage summary as
> described in the mod_perl cookbook.
> 
> I've tried putting the following two snippets into my httpd.conf (at
> separate times).
> 
> <Location /perl-status>
> SetHandler perl-script
> PerlHandler Apache::Status
> PerlSetVar StatusTerse On
> PerlSetVar StatusTerseSize On
> PerlSetVar StatusTerseSizeMainSummary On
> PerlSetVar StatusDumper On
> PerlSetVar StatusPeek On
> order deny,allow
> #deny from all
> #allow from
> </Location>
> 
> ... and the second ...
> 
> <Location /perl-status>
> SetHandler perl-script
> PerlHandler Apache::Status
> PerlSetVar StatusOptionsAll On
> order deny,allow
> #deny from all
> #allow from
> </Location>
> 
> Neither of these give me the "Memory Usage" link in the top level page that
> the cookbook talks about.  (Other such links are present on module pages,
> but not at the top level.)
> 
> Can anyone tell me what I'm missing here?

So, I looked into this.  Turns out that B::TerseSize actually adds the
top-level 'Memory Usage' memory item.  However it must be required
after Apache::Status.  Adding the following directives before your
perl-status Location block solves the problem.

  PerlModule Apache::Status
  PerlModule B::TerseSize

I'll add this as an errata to the Cookbook.  Of course I think you
shouldn't need the above work-around.  Later I'll dig into the source
and find out why it isn't working..

Thanks!


-- 
Paul Lindner    lindner@inuus.com   ||||| | | | |  |  |  |   |   |

    mod_perl Developer's Cookbook   http://www.modperlcookbook.org/
         Human Rights Declaration   http://www.unhchr.ch/udhr/

Re: StatusTerseSizeMainSummary

Posted by Ernest Lergon <er...@virtualitas.net>.
Ed Grimm wrote:
> 
> On Wed, 8 May 2002, Ernest Lergon wrote:
> > NB: Apache::Status will segfault, if I have 'use English' in a tested
> > module.
> 
> Just to confirm, you're stating that the difference between a working
> program and one that segfaults is the line 'use English;'?  Or does it
> require utilization of some of the aliases 'use English' generates?
> 
No, I wanted to say, that Apache::Status is segfaulting, when I try to
click Memory Usage for a loaded module, which has 'use English;'.
Without this (and the English varnames changed back to pure perl) it
will show up ok.

The module itself is working in both cases.

Ernest

-- 

*********************************************************************
* VIRTUALITAS Inc.               *                                  *
*                                *                                  *
* European Consultant Office     *      http://www.virtualitas.net  *
* Internationales Handelszentrum *   contact:Ernest Lergon          *
* Friedrichstraße 95             *    mailto:Ernest@virtualitas.net *
* 10117 Berlin / Germany         *       ums:+49180528132130266     *
*********************************************************************
       PGP-Key http://www.virtualitas.net/Ernest_Lergon.asc


Re: Forgot

Posted by jo...@tcpbbs.net.
Excellant! So installation will not affect libs or anything? Thats what i
was worried about. I will try it that way to make sure my perls are ok.

Thanks,
John
|-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|
| http://www.sexy-match.com                            |
|"The Internets Premier Adult Match Maker"     |
|-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|


>
> You can install a mod_perl-enabled Apache into a test directory and
> run it on a higher port than a vanilla Apache server.  This can allow
> you to verify that all is well before killing an existing
> installation.
>
> ky
>


Re: Forgot

Posted by "Ken Y. Clark" <kc...@logsoft.com>.
On Wed, 8 May 2002 john.buwa@tcpbbs.net wrote:

> Date: Wed, 8 May 2002 12:33:37 -0500
> From: john.buwa@tcpbbs.net
> To: modperl@apache.org
> Subject: Forgot
>
> Sorry,
>
> Forgot in my last message to ask, can you run a test setup and a regular
> apache on the same machine? I.e. one running mod perl and one not?
>
> Thanks!
> John

You can install a mod_perl-enabled Apache into a test directory and
run it on a higher port than a vanilla Apache server.  This can allow
you to verify that all is well before killing an existing
installation.

ky


Forgot

Posted by jo...@tcpbbs.net.
Sorry,

Forgot in my last message to ask, can you run a test setup and a regular
apache on the same machine? I.e. one running mod perl and one not?

Thanks!
John
|-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|
| http://www.sexy-match.com                            |
|"The Internets Premier Adult Match Maker"     |
|-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|




Re: StatusTerseSizeMainSummary

Posted by Ernest Lergon <er...@virtualitas.net>.
Sorry,

I should have read carefully...

I can't call Memory Usage on main page /perl-status, too.

error_log tells me:

[Wed May  8 17:51:40 2002] [error] Can't locate object method "size"
via package "U‰åƒìS¡Ä`F@…Àt‰Ã‹£Ä`F@ÿ iF@ë芗ÿÿ‰ÃÇ" at
/usr/lib/perl5/site_perl/5.6.0/i586-linux/B/Size.pm line 94.

B::Size.pm:

90: sub B::AV::size {
91:     my $sv = shift;
92:     my $size = B::Sizeof::AV + B::Sizeof::XPVAV;
93:     my @vals = $sv->ARRAY;
94:     for (my $i = 0; $i <= $sv->MAX; $i++) {
95:         $size += $vals[$i] ? $vals[$i]->size : B::Sizeof::SV;
96:     }
97:     $size;
98: }

Any idea?

Ernest



-- 

*********************************************************************
* VIRTUALITAS Inc.               *                                  *
*                                *                                  *
* European Consultant Office     *      http://www.virtualitas.net  *
* Internationales Handelszentrum *   contact:Ernest Lergon          *
* Friedrichstraße 95             *    mailto:Ernest@virtualitas.net *
* 10117 Berlin / Germany         *       ums:+49180528132130266     *
*********************************************************************
       PGP-Key http://www.virtualitas.net/Ernest_Lergon.asc


Re: StatusTerseSizeMainSummary

Posted by Ernest Lergon <er...@virtualitas.net>.
sminer@ChrBook.com wrote:
> 
> I'm trying to use /perl-status to do some analysis on my mod_perl server
> (v.1.25). I'm trying to enable the top-level module memory usage summary as
> described in the mod_perl cookbook.
> 
On my

Apache/1.3.19 (Unix) (SuSE/Linux) mod_perl/1.25
This is perl, v5.6.0 built for i586-linux

I have to load B::* in startup.pl manually using

<Location /perl-status>
	SetHandler	perl-script
	PerlSetVar	StatusOptionsAll	On
	PerlHandler	Apache::Status
</Location>


NB: Apache::Status will segfault, if I have 'use English' in a tested
module.

Ernest


#!/usr/bin/perl

use strict;

# extend @INC if needed
use lib qw ( /usr/lib/mod_perl );

# make sure we are in a sane environment.
$ENV{GATEWAY_INTERFACE} =~ /^CGI-Perl/
	or die "GATEWAY_INTERFACE not Perl!";

# for things in the "/perl" URL
use Apache::Registry;

#load status modules before any other modules

use Apache::Status;

use B::Deparse;
use B::TerseSize;
use B::Terse;
use B::Size;

#load perl modules of your choice here
#this code is interpreted *once* when the server starts

use Data::Dumper;
use MyModule;

#etc.



-- 

*********************************************************************
* VIRTUALITAS Inc.               *                                  *
*                                *                                  *
* European Consultant Office     *      http://www.virtualitas.net  *
* Internationales Handelszentrum *   contact:Ernest Lergon          *
* Friedrichstraße 95             *    mailto:Ernest@virtualitas.net *
* 10117 Berlin / Germany         *       ums:+49180528132130266     *
*********************************************************************
       PGP-Key http://www.virtualitas.net/Ernest_Lergon.asc