From: Mike S. <m...@pe...> - 2007-04-20 00:31:13
|
Interesting claim by a module called Log::Cabin on CPAN :). -- Mike Mike Schilli m...@pe... ---------- Forwarded message ---------- From: Mike Schilli <m...@pe...> To: Robert Hicks <rob...@ma...> Cc: m...@pe... Subject: Re: A question on disk usage... Date: Thu, 19 Apr 2007 15:19:30 -0700 (PDT) On Thu, 19 Apr 2007, Robert Hicks wrote: > Log::XXX provides a selection of the features of Log::Log4perl but > with a focus on reduced disk IO. Just calling 'use Log::Log4perl' > results in hundreds of stat calls to the file system. If you have a > shared file system with many nodes running perl scripts at once, this > could result in a significant decrease in performance. Interesting, never heard of this claim before. Let's look at the facts: Perl does a lot of stat() calls because of the way it searches for modules in the %INC path: $ strace perl -MFoo::Bar::Baz -e1 2>&1 | grep stat64 | wc -l 54 So for a *non-existent* module, you get 54 stat() calls! Let's try the same thing with Log::Log4perl: $ strace perl -MLog::Log4perl -e1 2>&1 | grep stat64 | wc -l 151 Definitely more, but I've never seen that to be a problem. However, if you run short scripts on NFS in quick succession, I can see that to be a problem. Which we could resolve easily by offering something like use Log::Log4perl qw(:fast); implementing lazy loading. As a matter of fact, I'm gonna put that on the list for one of the next releases. > After implementing this module we were able to cut up to 70,000 stat/ > open calls per second on our NFS. That's an odd claim, because it says nothing about how many stat calls there were before and after. If it got improved by only 10%, then the new module is useless. And, as I've already mentioned, there can be a negative impact if you have many calls to short scripts -- in which case you should be running a persistent perl interpreter like mod_perl or pperl and get rid of module loading I/O entirely. > Of course, this module doesn't > currently support all the features of Log::Log4perl, but many of the > most comment ones are implemented. Would be interesting to know how much functionality is actually implemented and if it's any different than the 20 other log modules on CPAN :). Do you happen to know more about where it's available? Would you be ok if I forwarded this email to the L4p mailing list? Thanks for the note! -- Mike Mike Schilli m...@pe... |
From: Johannes K. <Joh...@vi...> - 2007-05-03 14:07:30
|
Hi Mike, a simple one-liner using Log::Log4Perl produces a lot of redefinitons. What does this mean and how can I avoid it? (Longer programs produces this output too when using Log::Log4perl and starting the script ... that's annoying) (Using ActiveStatePerl 5.8.8.817 and Log::Log4Perl 1.06 or 1.10) Thanks Johannes ----------------------- C:\WINDOWS>perl -we "use Log::Log4Perl; print @INC;" Constant subroutine Log::Log4perl::_INTERNAL_DEBUG redefined at C:/Programme/Perl/lib/constant.pm line 103. Subroutine import redefined at C:/Programme/Perl/site/lib/Log/Log4Perl.pm line 69. Subroutine initialized redefined at C:/Programme/Perl/site/lib/Log/Log4Perl.pm line 207. Subroutine new redefined at C:/Programme/Perl/site/lib/Log/Log4Perl.pm line 213. Subroutine reset redefined at C:/Programme/Perl/site/lib/Log/Log4Perl.pm line 220. Subroutine init_once redefined at C:/Programme/Perl/site/lib/Log/Log4Perl.pm line 227. Subroutine init redefined at C:/Programme/Perl/site/lib/Log/Log4Perl.pm line 234. Subroutine init_and_watch redefined at C:/Programme/Perl/site/lib/Log/Log4Perl.pm line 248. Subroutine easy_init redefined at C:/Programme/Perl/site/lib/Log/Log4Perl.pm line 263. Subroutine get_logger redefined at C:/Programme/Perl/site/lib/Log/Log4Perl.pm line 337. Subroutine appenders redefined at C:/Programme/Perl/site/lib/Log/Log4Perl.pm line 359. Subroutine appender_thresholds_adjust redefined at C:/Programme/Perl/site/lib/Log/Log4Perl.pm line 365. Subroutine appender_by_name redefined at C:/Programme/Perl/site/lib/Log/Log4Perl.pm line 403. Subroutine eradicate_appender redefined at C:/Programme/Perl/site/lib/Log/Log4Perl.pm line 420. Subroutine infiltrate_lwp redefined at C:/Programme/Perl/site/lib/Log/Log4Perl.pm line 428. C:/Programme/Perl/libC:/Programme/Perl/site/lib. |
From: Kevin M. G. <cp...@go...> - 2007-05-03 16:39:16
|
Johannes Kilian wrote: > Hi Mike, > > a simple one-liner using Log::Log4Perl produces a lot of redefinitons. What does this mean and how can I avoid it? (Longer programs produces this output too when using Log::Log4perl and starting the script ... that's annoying) > (Using ActiveStatePerl 5.8.8.817 and Log::Log4Perl 1.06 or 1.10) > > C:\WINDOWS>perl -we "use Log::Log4Perl; print @INC;" The package name is Log4perl with a lowercase 'p', not capital. I don't have a windows box handy, but try that instead. I'd bet windows or activestate is doing something fancy vis-a-vis windows' case insensitiviy. perl -we "use Log::Log4perl; print @INC;" |
From: Johannes K. <Joh...@vi...> - 2007-05-04 04:56:12
|
Hi Kevin, Kevin M. Goess schrieb: > Johannes Kilian wrote: > >> Hi Mike, >> >> a simple one-liner using Log::Log4Perl produces a lot of redefinitons. What does this mean and how can I avoid it? (Longer programs produces this output too when using Log::Log4perl and starting the script ... that's annoying) >> (Using ActiveStatePerl 5.8.8.817 and Log::Log4Perl 1.06 or 1.10) >> >> C:\WINDOWS>perl -we "use Log::Log4Perl; print @INC;" >> > > The package name is Log4perl with a lowercase 'p', not capital. I don't > have a windows box handy, but try that instead. I'd bet windows or > activestate is doing something fancy vis-a-vis windows' case insensitiviy. > > perl -we "use Log::Log4perl; print @INC;" > Thank you - that's it. Never thought it could be anything like this ... Johannes |
From: Lee G. <LGo...@UK...> - 2007-05-04 11:36:38
|
> From: log...@li... [mailto:log4perl-devel- > bo...@li...] On Behalf Of Kevin M. Goess >=20 > Johannes Kilian wrote: > > Hi Mike, > > > > a simple one-liner using Log::Log4Perl produces a lot of redefinitons. > What does this mean and how can I avoid it? (Longer programs produces this > output too when using Log::Log4perl and starting the script ... that's > annoying) > > (Using ActiveStatePerl 5.8.8.817 and Log::Log4Perl 1.06 or 1.10) > > > > C:\WINDOWS>perl -we "use Log::Log4Perl; print @INC;" >=20 > The package name is Log4perl with a lowercase 'p', not capital. I don't > have a windows box handy, but try that instead. I'd bet windows or > activestate is doing something fancy vis-a-vis windows' case insensitiviy. >=20 > perl -we "use Log::Log4perl; print @INC;" I have Windows XP box with AS Perl 5.8.8, which produces the following, if it helps: Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\lgoddard>which perl.exe F:\dev\perl588\bin\perl.exe C:\Documents and Settings\lgoddard>perl -we "use Log::Log4perl; print @INC;" F:\dev\perl588\siteF:\dev\perl588\site\libF:/dev/perl588/site/libF:/dev/ perl588/ lib. C:\Documents and Settings\lgoddard> Lee |