Thread View: news.software.nntp
12 messages
12 total messages
Started by Miquel van Smoorenburg
Fri, 05 Jul 2002 10:45
innd perl filter slowdown ?
Author: Miquel van Smoorenburg
Date: Fri, 05 Jul 2002 10:45
Date: Fri, 05 Jul 2002 10:45
25 lines
2114 bytes
2114 bytes
Recently our newsservers running cleanfeed have experienced enormous slowdowns. Sometimes, out of the blue, innd will continously "block" for a few seconds. "iostat" shows stalled disk activity and /news/log/news shows no articles being accepted. This happends a few times a week and will continue for hours at an end. See for example http://stats.cistron.nl/mrtg/html/wormhole.html It turned out to be the perl filter - "ctlinnd perl n" fixed it. On one server, I run cleanfeed - on the other (our feeder) I run a stripped down filter that just checks for binary-in-nonbin groups using the regexp from cleanfeed, and enforces usenet2/bofh policies. Both servers behave the same. The servers are running 2.4-cvs (of about 6-9 months ago, but in the mean time nothing serious has changed) linked against perl 5.6 I also get big backlogs to some of my peers of which I suspect that they run cleanfeed to, possibly they experience the same. Has anyone else seen these slowdowns? Could it be caused by patterns in certain postings that trigger anomalous behaviour in perl. Yenc with its long lines perhaps ? Mike.
Re: innd perl filter slowdown ?
Author: jochem.nospam
Date: Fri, 05 Jul 2002 11:05
Date: Fri, 05 Jul 2002 11:05
13 lines
1557 bytes
1557 bytes
Miquel van Smoorenburg <miquels@cistron.nl> wrote: > Has anyone else seen these slowdowns? Could it be caused by > patterns in certain postings that trigger anomalous behaviour > in perl. Yenc with its long lines perhaps ? Maybe it is the site you get your feed from, it might have difficulties negotioting a tcp connection with your server. Another possibility would be when you accept very huge articles that cleanfeed has to go through. That takes a lot of time. jochem
Re: innd perl filter slowdown ?
Author: Miquel van Smoorenburg
Date: Fri, 05 Jul 2002 11:11
Date: Fri, 05 Jul 2002 11:11
24 lines
2089 bytes
2089 bytes
In article <ag3uhe$jev$1@deneb.it.vu.nl>, <jochem.nospam@nospam.it.vu.nl> wrote: >Miquel van Smoorenburg <miquels@cistron.nl> wrote: >> Has anyone else seen these slowdowns? Could it be caused by >> patterns in certain postings that trigger anomalous behaviour >> in perl. Yenc with its long lines perhaps ? > >Maybe it is the site you get your feed from, it might have difficulties >negotioting a tcp connection with your server. Ehm. I have many many peers ;) And like I said the problem is fixed *at the exact moment* I do a "ctlinnd perl n" >Another possibility would be when you accept very huge articles that >cleanfeed has to go through. That takes a lot of time. Cleanfeed only looks at the first 20 lines, at least that's how the regexp is designed. If perl internally tries to interpret the entire article instead of the first 20 lines like the regexp says, then that might be the problem - and that's exactly what I'm trying to find out. Mike.
Re: innd perl filter slowdown ?
Author: Marco d'Itri
Date: Fri, 05 Jul 2002 12:30
Date: Fri, 05 Jul 2002 12:30
9 lines
1206 bytes
1206 bytes
miquels@cistron.nl wrote: >Recently our newsservers running cleanfeed have experienced Which version? -- ciao, | Marco | * The Internet is full. Go away. -- Joel Furr *
Re: innd perl filter slowdown ?
Author: Brian Edmonds
Date: Fri, 05 Jul 2002 15:16
Date: Fri, 05 Jul 2002 15:16
16 lines
1693 bytes
1693 bytes
"Miquel van Smoorenburg" <miquels@cistron.nl> writes: > Recently our newsservers running cleanfeed have experienced enormous > slowdowns. Sometimes, out of the blue, innd will continously "block" > for a few seconds. I know on the (older) INN2 installation with a custom perl filter that I used to maintain at ubc-cs the perl filter would occasionally stall out somewhere deep in the regexp code. I found I could get it going again by using gdb to attach to innd and force a return of the current stack frame. Kinda scary, but it worked. I have no idea if this has any bearing on your current problem, but it seemed similar enough to share. :) Brian.
Re: innd perl filter slowdown ?
Author: Russ Allbery
Date: Fri, 05 Jul 2002 15:40
Date: Fri, 05 Jul 2002 15:40
29 lines
2203 bytes
2203 bytes
Miquel van Smoorenburg <miquels@cistron.nl> writes:
> It turned out to be the perl filter - "ctlinnd perl n" fixed it. On one
> server, I run cleanfeed - on the other (our feeder) I run a stripped
> down filter that just checks for binary-in-nonbin groups using the
> regexp from cleanfeed, and enforces usenet2/bofh policies. Both servers
> behave the same.
Which binary regex are you using? Some of them have a nasty bug where
they can go into exponential backtracking on certain articles. There was
some extensive discussion of that here a year or more ago. The version
I'm currently using is:
# How we determine if a post is a binary.
sub is_binary {
($hdr{__BODY__} =~ m%(?:^[ \t>]*(?>M[\x20-\x60]{59,60})[ \r]*\n){40}%mo
|| $hdr{__BODY__} =~ m%(?:^[ \t>]*[A-Za-z0-9+/]{59,76}[ \r]*\n){40}%mo);
}
The (?>...) bit in there is the important bit, since it prevents
backtracking inside the construct. There are a few other ways of
rewriting the regex that also work.
--
Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>
Please post questions rather than mailing me directly.
<http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: innd perl filter slowdown ?
Author: Miquel van Smoorenburg
Date: Sat, 06 Jul 2002 12:50
Date: Sat, 06 Jul 2002 12:50
43 lines
2561 bytes
2561 bytes
In article <yl65zunpyc.fsf@windlord.stanford.edu>,
Russ Allbery <rra@stanford.edu> wrote:
>Miquel van Smoorenburg <miquels@cistron.nl> writes:
>
>> It turned out to be the perl filter - "ctlinnd perl n" fixed it. On one
>> server, I run cleanfeed - on the other (our feeder) I run a stripped
>> down filter that just checks for binary-in-nonbin groups using the
>> regexp from cleanfeed, and enforces usenet2/bofh policies. Both servers
>> behave the same.
>
>Which binary regex are you using?
The one from cleanfeed-20010805.
>Some of them have a nasty bug where
>they can go into exponential backtracking on certain articles. There was
>some extensive discussion of that here a year or more ago.
That does sound a lot like the problem I'm seeing.
>The version
>I'm currently using is:
>
># How we determine if a post is a binary.
>sub is_binary {
> ($hdr{__BODY__} =~ m%(?:^[ \t>]*(?>M[\x20-\x60]{59,60})[ \r]*\n){40}%mo
> || $hdr{__BODY__} =~ m%(?:^[ \t>]*[A-Za-z0-9+/]{59,76}[ \r]*\n){40}%mo);
>}
That looks very much the same as the one from cleanfeed-20010805.
>The (?>...) bit in there is the important bit, since it prevents
>backtracking inside the construct. There are a few other ways of
>rewriting the regex that also work.
I've now put some gettimeofday() calls into the filter, and
logging, so hopefully that will help tracking down where the
problem lies.
Thanks,
Mike.
Re: innd perl filter slowdown ?
Author: Marco d'Itri
Date: Sat, 06 Jul 2002 13:17
Date: Sat, 06 Jul 2002 13:17
16 lines
1516 bytes
1516 bytes
miquels.at.cistron.nl.spamtrap@netscum.nl wrote:
>># How we determine if a post is a binary.
>>sub is_binary {
>> ($hdr{__BODY__} =~ m%(?:^[ \t>]*(?>M[\x20-\x60]{59,60})[ \r]*\n){40}%mo
>> || $hdr{__BODY__} =~ m%(?:^[ \t>]*[A-Za-z0-9+/]{59,76}[ \r]*\n){40}%mo);
>>}
>
>That looks very much the same as the one from cleanfeed-20010805.
Yes, I believe all clenfeed versions released by me do not have this
problem.
--
ciao, |
Marco | * The Internet is full. Go away. -- Joel Furr *
Re: innd perl filter slowdown ?
Author: Miquel van Smoorenburg
Date: Sat, 06 Jul 2002 18:46
Date: Sat, 06 Jul 2002 18:46
51 lines
3030 bytes
3030 bytes
In article <yl65zunpyc.fsf@windlord.stanford.edu>,
Russ Allbery <rra@stanford.edu> wrote:
>Miquel van Smoorenburg <miquels@cistron.nl> writes:
>
>> It turned out to be the perl filter - "ctlinnd perl n" fixed it. On one
>> server, I run cleanfeed - on the other (our feeder) I run a stripped
>> down filter that just checks for binary-in-nonbin groups using the
>> regexp from cleanfeed, and enforces usenet2/bofh policies. Both servers
>> behave the same.
>
>Which binary regex are you using? Some of them have a nasty bug where
>they can go into exponential backtracking on certain articles. There was
>some extensive discussion of that here a year or more ago. The version
>I'm currently using is:
>
># How we determine if a post is a binary.
>sub is_binary {
> ($hdr{__BODY__} =~ m%(?:^[ \t>]*(?>M[\x20-\x60]{59,60})[ \r]*\n){40}%mo
> || $hdr{__BODY__} =~ m%(?:^[ \t>]*[A-Za-z0-9+/]{59,76}[ \r]*\n){40}%mo);
>}
Okay, found it. The one from cleanfeed, condensed down to two lines, is:
sub is_binary {
($hdr{__BODY__} =~ /(?:^[ \t|>]*(?>M[\x20-\x60]{60,61})\s*\r?\n){40}/mo
or $hdr{__BODY__} =~ /(?:^[ \t|>]*(?>[A-Za-z0-9\+\/]{59,76})\s*\r?\n){40}/mo);}
I found an article of 139 lines that takes some seven seconds to be processed
by the expression above. Replacing
\s*\r?
with
[ \r]*
as in Russ' version, makes the problem go away.
The slow article triggering this bug is <MPG.8f86beb28999@news.mts.net>
Anytime a flood of articles like this hit usenet, cleanfeed
throws a fit .. it's some kind of sporgery, apparently.
Marco, you might want to test the latest cleanfeed against this
article.
Also, the regexp from cleanfeed and Russ differ slightly in that
a) cleanfeed: ^[ \t|>] Russ: ^[ \t>] (quoting, I suppose)
b) cleanfeed: {60,61} Russ: {59,60}
Which one is right? One of them appears to be off-by-one ?
Mike.
Re: innd perl filter slowdown ?
Author: Russ Allbery
Date: Sat, 06 Jul 2002 19:05
Date: Sat, 06 Jul 2002 19:05
22 lines
1890 bytes
1890 bytes
Miquel van Smoorenburg <miquels.at.cistron.nl.spamtrap@netscum.nl> writes:
> Also, the regexp from cleanfeed and Russ differ slightly in that
> a) cleanfeed: ^[ \t|>] Russ: ^[ \t>] (quoting, I suppose)
Yup. Cleanfeed probably added | at some point because someone was seeing
a lot of binaries quoted that way.
> b) cleanfeed: {60,61} Russ: {59,60}
> Which one is right? One of them appears to be off-by-one ?
60 is right. Either 61 or 59 is wrong; it would be the product of a bad
uuencoder. I'm not sure if either is common. What I have started as what
was in a much older version of Cleanfeed.
--
Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>
Please post questions rather than mailing me directly.
<http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: innd perl filter slowdown ?
Author: Marco d'Itri
Date: Sun, 07 Jul 2002 15:58
Date: Sun, 07 Jul 2002 15:58
32 lines
2332 bytes
2332 bytes
miquels.at.cistron.nl.spamtrap@netscum.nl wrote:
>sub is_binary {
> ($hdr{__BODY__} =~ /(?:^[ \t|>]*(?>M[\x20-\x60]{60,61})\s*\r?\n){40}/mo
> or $hdr{__BODY__} =~ /(?:^[ \t|>]*(?>[A-Za-z0-9\+\/]{59,76})\s*\r?\n){40}/mo);}
>
>I found an article of 139 lines that takes some seven seconds to be processed
>by the expression above. Replacing
>
> \s*\r?
>with
> [ \r]*
I suppose the problem is * followed by ?.
Anyway, since \s matches \r too I can just remove \r?, I will make a new
release in a couple of days.
I will audit the code for other regexes with this pattern.
>Also, the regexp from cleanfeed and Russ differ slightly in that
>a) cleanfeed: ^[ \t|>] Russ: ^[ \t>] (quoting, I suppose)
>b) cleanfeed: {60,61} Russ: {59,60}
>
>Which one is right? One of them appears to be off-by-one ?
I copied {60,61} from the original cleanfeed by Jeremy, maybe he can
explain. Please let me know if anybody thinks I should change this.
I'm not sure about where I picked up | as a quoting character, looks
like I added myself so this probably means I've found enough quoted
binaries on my old full feed server.
--
ciao, |
Marco | * The Internet is full. Go away. -- Joel Furr *
Re: innd perl filter slowdown ?
Author: Miquel van Smoorenburg
Date: Mon, 08 Jul 2002 10:59
Date: Mon, 08 Jul 2002 10:59
33 lines
2235 bytes
2235 bytes
In article <ag9ofv$8iq$1@wonderland.linux.it>,
Marco d'Itri <abuse@1.2.0.1.0.0.1.e.f.f.3.ip6.int> wrote:
>miquels.at.cistron.nl.spamtrap@netscum.nl wrote:
>
>>sub is_binary {
>> ($hdr{__BODY__} =~ /(?:^[ \t|>]*(?>M[\x20-\x60]{60,61})\s*\r?\n){40}/mo
>> or $hdr{__BODY__} =~ /(?:^[
>\t|>]*(?>[A-Za-z0-9\+\/]{59,76})\s*\r?\n){40}/mo);}
>>
>>I found an article of 139 lines that takes some seven seconds to be processed
>>by the expression above. Replacing
>>
>> \s*\r?
>>with
>> [ \r]*
>I suppose the problem is * followed by ?.
I tested it, and yes, that is the problem.
>Anyway, since \s matches \r too I can just remove \r?
I tested that as well and changing \s*\r? to \s* works just fine.
>I will make a new release in a couple of days.
In that case this might come in handy:
sub is_yenc {
$hdr{__BODY__} =~ m/^=ybegin[^\n]+\n(?>(:?=ypart[^\n]+\n)?)(?>[^\r\n]{62,999}\r?\n){40}/mo;
}
Mike.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads