ePN Was Performance issues.

Stanley.Hopcroft at Dest.gov.au Stanley.Hopcroft at Dest.gov.au
Thu Jan 4 00:13:22 CET 2007


Dear Sir,

I am writing to thank you for your letter and say, 

> -----Original Message-----
> From: "Robert Hajime Lanning" <lanning at lanning.cc>
> Subject: Re: [Nagios-users] Performance issues, too1


  .. skipped helpful remarks.

> 
> The perl code path that runs in the master Nagios process (after
> all pluggins have been compiled successfully and you remove argument
> caching) is:
> 
> sub eval_file {
>    my ($filename, $delete, undef, $plugin_args) = @_ ;
>    my $mtime = -M $filename ;
>    if ( exists($Cache{$filename}) && $Cache{$filename}[MTIME]
>         && ($Cache{$filename}[MTIME] >= $mtime)) {
>       if ( $Cache{$filename}[PLUGIN_ERROR] ) {
>          ...
>       } else {
>          return $Cache{$filename}[PLUGIN_HNDLR];
>       };
>    };
> };
> 
> I am not sure where the leak is, unless it is in the interpreter
> itself.
> 

It probably is, since most of the published documents (eg perlembed,
'Extending and
Embedding Perl') emphasise the _big_ tradeoffs with embedding Perl.

Thank you for repeating the code in your letter as I was trying to
remember how
it works and grappling with the fact that once the plugins are converted
into
Perl subroutines and compiled, the C caller (in checks.c) should simply
be able to load the 
Perl stack with the Plugin arguments - as is done in checks.c - and then
call Perl_call_sv()
with the subroutine reference returned by eval_file (the content of 
return $Cache{$filename}[PLUGIN_HNDLR]).

What happens is more complicated than this and I can't see why at the
moment.

(Part of the complexity is that the C args must be converted to Perl,
and 
I think I preferred a second call to Perl to do this [after which Perl
calls the subroutine
itself] rather than converting the arguments - which is tricky - in C
and then calling
the subroutine from C).

1 refactor the Perl/C interface with a view to improving
efficiency/readability/comprehensibility
(I thought I understood ..)

2 consider a different approach with PPerl.

BTW, for those wishing to play with this, contrib/new_mini_epn.c has
most of the guts
of the C interface (and uses the same Perl driver in p1.pl) may be the
easiest way
to start. (The main difference between this and the Nag code is that the
Nag code forks
for each plugin).

Thank you,

Yours sincerely.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list