Thread View: news.software.nntp
2 messages
2 total messages
Started by Curse of the One and Only Real T...
Mon, 11 Sep 2000 05:35
ARTclean() is wicked slow, or something.
Author: Curse of the One and Only Real T...
Date: Mon, 11 Sep 2000 05:35
Date: Mon, 11 Sep 2000 05:35
16 lines
1367 bytes
1367 bytes
Plan One and Only Real True Fluffy From Outer Space <ftc@meowing.dQ> meows: > I was thinking the same thing until I added a few lines of debuggery > and saw quite a bit of time was unaccounted for in the supplied k0de, > and there could be further optimizations done to speed things up. [TMR_ARTCLEAN patches ...] I'm just making a nuisance of myself by pointing out stuff that 80% of this group's readers probably went and plonked. WHATEVER YOU DO, DO NOT, I REPEAT DO NOT OPEN THE ARTICLE IN THE REFERENCES HEADER. THANK YOU FOR YOUR COOPERATION. -- Meow.
Re: ARTclean() is wicked slow, or something.
Author: The Disappearing One and Only Re...
Date: Mon, 11 Sep 2000 06:30
Date: Mon, 11 Sep 2000 06:30
274 lines
11737 bytes
11737 bytes
On 2568 Sep 1993, Curse of the One and Only Real True Fluffy meowed:
> I'm just making a nuisance of myself by pointing out stuff that 80% of
> NOT, I REPEAT DO NOT OPEN THE ARTICLE IN THE REFERENCES HEADER. THANK
THAT ARTICLE IS NOT PRESENT ON ANY PROPERLY-CONFIGURED NEWS SWERVER.
YOU NEED TO DUMP S00PERNEWZ AND SUSCIRBE TO SOMEWHERE THAT ACTUALLY
FOLLOWS THE RFCS ABOUT CONTROL CANCEL MESSAGES. HTH, HAND, M.
I'm not sure if the following is right, either, but It Werks Fer Me
and that's all that matters, isn't it
--- /news/lib/innreport_inn.pm-ORIG Tue Sep 5 11:01:51 2000
+++ /news/lib/innreport_inn.pm Sun Sep 10 03:17:58 2000
@@ -48,6 +48,8 @@
# collect: Used to collect the data.
sub collect {
my ($day, $hour, $prog, $res, $left, $CASE_SENSITIVE) = @_;
+ my $logt = log (10);
+
return 1 if $left =~ /Reading config from (\S+)$/o;
@@ -68,16 +70,90 @@
# or
# server <msg-id> (filename) size [feeds]
- my ($s) = $left =~ /^\S+ \S+ (?:\(\S+\) )?(\d+)(?: |$)/o;
+ my ($host_name,$s) = $left =~ /^(\S+) \S+ (?:\(\S+\) )?(\d+)(?: |$)/o;
if ($s) {
+ $inn_flow_host_count{$host_name}++;
+ $inn_flow_host_byte{$host_name} += $s;
$inn_flow_size{"$day $hour"} += $s;
$inn_flow_size_total += $s;
+ # This is ugly. Make a count of different sized articles
+ my $index = 01;
+ my $increment = 1.189207115;
+ my $ref = 100;
+ while ($s > $ref) {
+ $index++;
+ $ref = ($ref * $increment);
+ }
+ $inn_flow_count{$index}++;
+ $inn_flow_count_size{$index} += $s;
+######## Prepare to make a chart
+
+#### Grab sizes out of the logfile
+ $size = $s;
+ $done++;
+ $tsize += $size;
+### won't be reached, these are bytes
+ if ($size < 45)
+ {
+ $l = $size;
+ }
+##### get a decent distribution
+ else
+ {
+ $l = sprintf "%.2f", log ($size) / $logt;
+ # look at $prec to know the precision
+ # trunc again
+ $l = sprintf "%d", 10 ** $l;
+ }
+ # and finally store
+ #$ll{'count'}{$l}++;
+ #$ll{'size'}{$l} += $size;
+ $ll{$l}++;
+ $lsize{$l} += $size;
+#print "l $l count $ll{'count'}{$l} size $ll{'size'}{$l}\n";
+
+########
}
return 1;
}
+# XXXXXX article has been rejected, and may have the size logged as well
+# but only with the s00per 3l33T k0deZ I've applied here
+
+#### First memorize the size. Merge in the k0dez for this, I'm lazy today
+
+ # rejected article
+ # Custom hackery may log article size for tossed articles.
+ # If article is in unwanted group but wanted, there will be two
+ # logfile lines -- first, name of group, second, j with size and
+ # sites for this article
+ # Other tossed articles may have the size before 437, or may not
+
+ # Memorize the size. This can only be done with INN with S00PER
+ # 3L33T H@(KS that I've written
+
+ # server <msg-id> size 437 [reason]
+
+ my ($host_name,$s) = $left =~ /^(\S+) \S+ (?:\(\S+\) )?(\d+) 437 /o;
+ if ($s)
+ {
+ $inn_junk_host_count{$host_name}++;
+ $inn_junk_host_byte{$host_name} += $s;
+ # Heh, we can superimpose the graph by hour of trash over innflow
+ $inn_junk_size{"$day $hour"} += $s;
+ $inn_junk_size_total += $s;
+# Perhaps should initialize all host names from inn_flow? Or vice versa?
+# Wonder what happens when a peer sends us only junk and we take none
+ }
+
+# Boy this is going to be ugly
+# Should just strip out the size
+
+#### Second, loop through the reasons, this time looking for the size too
+
# 437 Duplicate article
- if ($left =~ /(\S+) <[^>]+> 437 Duplicate(?: article)?$/o) {
+ if ($left =~ /(\S+) <[^>]+>(?: \d+)? 437 Duplicate(?: article)?$/o) {
+ # if ($left =~ /(\S+) <[^>]+> 437 Duplicate(?: article)?$/o) {
my $server = $1;
$server = lc $server unless $CASE_SENSITIVE;
$inn_badart{$server}++;
[chomp lots more of the same]
@@ -164,8 +240,17 @@
$inn_badart{$server}++;
return 1;
}
+ # 437 Line ## includes null character
+ if ($left =~ /(\S+) <[^>]+>(?: \d+)? 437 Line \d+ includes null character/o) {
+ my $server = $1;
+ $server = lc $server unless $CASE_SENSITIVE;
+ $innd_null_chars{$server}++;
+ $innd_others{$server}++;
+ $inn_badart{$server}++;
+ return 1;
+ }
# all others are just counted as "Other"
- if ($left =~ /(\S+) /o) {
+ if ($left =~ /(\S+) <[^>]+>(?: \d+)? /o) {
my $server = $1;
$server = lc $server unless $CASE_SENSITIVE;
$inn_badart{$server}++;
[Hang on, I see a mistake there]
@@ -361,9 +457,10 @@
artcncl\ (\d+)\((\d+)\)\s+ # artcncl
hishave\ (\d+)\((\d+)\) # hishave
(?:\s+hisgrep\ (\d+)\((\d+)\) # hisgrep (optional)
+ (?:\s+artclean\ (\d+)\((\d+)\) # artclean (optional)
(?:\s+perl\ (\d+)\((\d+)\) # perl (optional)
(?:\s+overv\ (\d+)\((\d+)\) # overv (optional)
- (?:\s+python\ (\d+)\((\d+)\))?)?)?)?)? # python (optional)
+ (?:\s+python\ (\d+)\((\d+)\))?)?)?)?)?)? # python (optional)
\s*$/ox) {
$innd_time_times += $1;
$innd_time_time{'idle'} += $2;
@@ -437,21 +534,29 @@
$innd_time_max{'history grep'} = $20 / ($21 || 1)
if $21 && $innd_time_max{'history grep'} < $20 / ($21 || 1);
if (defined($22) && defined($23)) {
- $innd_time_time{'perl filter'} += $22;
- $innd_time_num{'perl filter'} += $23;
- $innd_time_min{'perl filter'} = $22 / ($23 || 1)
- if $23 && $innd_time_min{'perl filter'} > $22 / ($23 || 1);
- $innd_time_max{'perl filter'} = $22 / ($23 || 1)
- if $23 && $innd_time_max{'perl filter'} < $22 / ($23 || 1);
- if (defined($24) && defined($25)) {
- $innd_time_time{'overview write'} += $24;
- $innd_time_num{'overview write'} += $25;
- $innd_time_min{'overview write'} = $24 / ($25 || 1)
- if $25 && $innd_time_min{'overview write'} > $24 / ($25 || 1);
- $innd_time_max{'overview write'} = $24 / ($25 || 1)
- if $25 && $innd_time_max{'overview write'} < $24 / ($25 || 1);
+ $innd_time_time{'article clean'} += $22;
+ $innd_time_num{'article clean'} += $23;
+ $innd_time_min{'article clean'} = $22 / ($23 || 1)
+ if $23 && $innd_time_min{'article clean'} > $22 / ($23 || 1);
+ $innd_time_max{'article clean'} = $22 / ($23 || 1)
+ if $23 && $innd_time_max{'article clean'} < $22 / ($23 || 1);
+ }
+ if (defined($24) && defined($25)) {
+ $innd_time_time{'perl filter'} += $24;
+ $innd_time_num{'perl filter'} += $25;
+ $innd_time_min{'perl filter'} = $24 / ($25 || 1)
+ if $25 && $innd_time_min{'perl filter'} > $24 / ($25 || 1);
+ $innd_time_max{'perl filter'} = $24 / ($25 || 1)
+ if $25 && $innd_time_max{'perl filter'} < $24 / ($25 || 1);
+ if (defined($26) && defined($27)) {
+ $innd_time_time{'overview write'} += $26;
+ $innd_time_num{'overview write'} += $27;
+ $innd_time_min{'overview write'} = $26 / ($27 || 1)
+ if $27 && $innd_time_min{'overview write'} > $26 / ($27 || 1);
+ $innd_time_max{'overview write'} = $26 / ($27 || 1)
+ if $27 && $innd_time_max{'overview write'} < $26 / ($27 || 1);
}
- }
+ }
}
return 1;
}
THE SCARY THING IS THAT THERE IS STILL LOTS OF UNACCOUNTED FOR TIME!
INND timer:
Code region Time Pct Invoked Min(ms) Avg(ms) Max(ms)
article cancel 00:00:00.000 0.0% 0 0.000 0.000 0.000
article clean 03:35:07.889 12.9% 451178 0.000 28.609 56.127
article control 00:00:00.000 0.0% 0 0.000 0.000 0.000
article link 00:00:00.000 0.0% 0 0.000 0.000 0.000
article write 07:31:12.717 27.0% 448583 48.593 60.352 76.404
history grep 00:00:00.000 0.0% 0 0.000 0.000 0.000
history lookup 00:16:04.063 1.0% 7859217 0.010 0.123 0.591
history sync 00:00:03.996 0.0% 2411 0.000 1.657 20.000
history write 00:22:35.426 1.4% 448796 0.331 3.020 9.242
idle 10:03:59.000 36.2% 29612767 0.696 1.224 5.536
overview write 00:00:00.000 0.0% 0 0.000 0.000 0.000
perl filter 00:00:01.325 0.0% 448583 0.000 0.003 0.025
site send 00:12:09.386 0.7% 1341155 0.285 0.544 1.096
TOTAL: 27:50:11 22:01:13.802 79.1% - - - -
THERE IS STILL ABOUT 20% TIME GONE MISSING EVEN WITH THIS WICKEDNESS!
THE ACCOUNTED-FOR TIME MATCHES THE 80% OF READERS WHO *PLONK*ED ME!
COINCIDENCE OR CONSPIRACY??!??!?!??!? I THINK NOT!!!1!
[Major Snippage and General Gnashingofteeth meet Corporal Punishment]
@@ -930,6 +1209,14 @@
$innxmit_tooold{$server}++;
return 1;
}
+ # 437 Rejected TooOld (Diablo)
+ if ($left =~ /(\S+) rejected [^\s]+ \(.*\) 437 Rejected TooOld$/o) {
+ my $server = $1;
+ $server = lc $server unless $CASE_SENSITIVE;
+ $innxmit_badart{$server}++;
+ $innxmit_tooold{$server}++;
+ return 1;
+ }
# 437 Unwanted site ... in path
if ($left =~
/(\S+) rejected [^\s]+ \(.*?\) 437 Unwanted site (\S+) in path$/o) {
@@ -937,7 +1224,7 @@
$server = lc $server unless $CASE_SENSITIVE;
$innxmit_badart{$server}++;
$innxmit_uw_site{$server}++;
- # $innxmit_site_path{$site}++;
+ $innxmit_site_path{$site}++;
return 1;
}
# 437 Unwanted newsgroup "..."
[elided]
@@ -2074,6 +2433,13 @@
my $msg = 'Including strange strings';
foreach $key (keys %innd_strange_strings) {
$innd_misc_stat{$msg}{$key} = $innd_strange_strings{$key};
+ }
+ }
+ if (%innd_null_chars) {
+ my $key;
+ my $msg = 'Null character in message body';
+ foreach $key (keys %innd_null_chars) {
+ $innd_misc_stat{$msg}{$key} = $innd_null_chars{$key};
}
}
if (%rnews_bogus_ng) {
I GOT MORE, I JES' THOUGHT I'D GIVE YA A SNEEK PREEVUE OF THE
HILITES. I hope I put in what I wanted above. I just woke up
so I'm nowhere near being semi-coherent. I AM NOT A CRANK.
my $meow;
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