[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Logwatch problem?

On Tuesday 21 April 2009 09:28:54 Gene Heskett wrote:
> I noticed my machine was lagging badly, so I took a look with htop,
> and
> /usr/bin/perl /usr/share/logwatch/scripts/shared/onlyservice init
> is using 99% of a core (4 core machine) and /dev/sda3 is showing
> about a 15Meg/sec continuous read operation.  This has been going
> on for at least an hour.
> What is it doing?

It's scanning a log file for messages from `init'.  I guess you have a 
*very* large log file that it is reading.  (Take a look at the Perl 
script /usr/share/logwatch/scripts/shared/onlyservice .  It's just 
matching on one of several different Perl regular expressions that 
include the string `init'.)

I see that the Perl regular expressions are suboptimal in that the 
quantifier `*' seems to be used in several places where it should be 
`+'.  This consumes more CPU than necessary.

> And why?

Because the logwatch program runs periodically to summarize 
"interesting" log messages.

Garry T. Williams --- +1 678 656-4579

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]