🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #90068

Re: Not very useful logging information

#90068
From: Julien ÉLIE
Date: Sat, 04 Feb 2023 11:50
91 lines
4466 bytes
Hi Jesse,

> I'm sure it would help. If the binary detection were performed first, and an
> article is identified as a binary then passed through without further checks
> would eliminate a lot of unncessary cycles.

Does it mean that if you turn off binary detection in Cleanfeed or 
PyClean, there's no longer any huge CPU load?

Something like "block_binaries => 0" for Cleanfeed and "bin_allowed = 
['\.']" (any newsgroup containing a dot will match) for PyClean.

It would be interesting to know, if CPU load is still high, which checks 
cause that.  For instance by disabling in Cleanfeed things like:

     do_md5 => 0
     do_scoring_filter => 0
     fuzzy_md5 => 0
     block_mime_html => 0  (and other block_html_* stuff)

and telling PyClean (in pyclean.py) that all groups are test groups, so 
as to disable many checks:

     test = ['\.']

Does the load become acceptable?


If that's not the case, there's a more fundamental problem that cannot 
be fixed by just optimizing Cleanfeed and PyClean regexps.



> I've been able to strip out most of the checks from Cleanfeed to one that is
> only checking for misplaced binaries and CPU impact is negligable compared to
> before. Beyond ripping everything out, I'm not a developer but sometimes
> manage to modify things to suit my needs. Likely not efficiently. :)

Did you also try to directly disable the checks with do_xxx => 0?



> The one thing I noticed early on with PyClean was the binary articles pass
> through all the other checks, or at least the EMP check and every so often one
> would be rejected from that part of the filter. That always seemed inefficient
> and I experiemented with the variable it uses to exclude groups but that
> didn't seem to work to exclude them from the EMP filter.

Even with:

   emp_exclude = ['\.']

in pyclean.py?



> If anyone has modified versions/patches they'd be interested in having me test
> for performance I'm capable of tossing a steady stream of mixed article flow
> at it.

Looking at Diablo's code to detect binaries... well, it's pretty 
straight-forward.  There aren't many checks done:
   https://github.com/jpmens/diablo/blob/master/lib/arttype.c

/*
  *
  *  Try and categorise an article into a range of types
  *
  *  We keep state info as the article is passed to us line by line
  *
  *  Once we have found an article type, we keep to that type unless
  *  we find a different type. We never reset.
  *
  *  Once we have found a binary, we stop scanning the article - save CPU
  *
  */

"save CPU" :-)


It could maybe be useful to do something similar in INN, and make the 
function available to embedded Perl and Python filters (like 
INN::havehist() and like).  They may run faster.
If of course Perl and Python filters without binary checking on already 
run fast enough.

-- 
Julien ÉLIE

« Passion is inversely proportional to the amount of real information
   available. » (Benford's law)
Technical Details
Message-ID: <trlgqa$kbge$1@news.trigofacile.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
References: <20230131155925.36dd4013@wibble.sysadmininc.com> <trjm6p$if11$1@news.trigofacile.com> <trjqja$sdm$1@nnrp.usenet.blueworldhosting.com> <trjrs6$j087$2@news.trigofacile.com> <trkpl9$1vg0$1@nnrp.usenet.blueworldhosting.com>

Show Full Headers
Complete Article Headers
Message-ID: <trlgqa$kbge$1@news.trigofacile.com>
Subject: Re: Not very useful logging information
Date: Sat, 4 Feb 2023 12:50:34 +0100
From: Julien ÉLIE <iulius@nom-de-mon-site.com.invalid>
References: <20230131155925.36dd4013@wibble.sysadmininc.com> <trjm6p$if11$1@news.trigofacile.com> <trjqja$sdm$1@nnrp.usenet.blueworldhosting.com> <trjrs6$j087$2@news.trigofacile.com> <trkpl9$1vg0$1@nnrp.usenet.blueworldhosting.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
Newsgroups: news.software.nntp
Organization: Groupes francophones par TrigoFACILE
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 4 Feb 2023 11:50:34 -0000 (UTC)
Injection-Info: news.trigofacile.com; posting-account="julien"; posting-host="176-143-2-105.abo.bbox.fr:176.143.2.105"; logging-data="667150"; mail-complaints-to="abuse@trigofacile.com"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.1
Cancel-Lock: sha1:zc855k4GKvnBKzi5EDdaNuNjJyM= sha256:p+fWHEPE4Gl/fYgKx55xWVpst8m7saa2DFRYYflzShI= sha1:QQci9bVjymSxGrdnn/vxFjR++Z4= sha256:oPBoavel+c5mZLwNrA1Se5uTHvMoZ0qyjTtP5g/wpA8=
In-Reply-To: <trkpl9$1vg0$1@nnrp.usenet.blueworldhosting.com>