Article View: news.software.nntp
Article #24513Re: Inn 1.7.2/Linux high CPU usage
From: Andrew Neely
Date: Fri, 19 Dec 1997 00:00
Date: Fri, 19 Dec 1997 00:00
57 lines
2487 bytes
2487 bytes
In article <349A4408.AB2F05F@skynet.be>, Stephan Forseilles
<steph@skynet.be> wrote:
>Joshua M. Thompson wrote:
>
>> I've found that even with a 0-day expire it still gets large enough to slow
>> things down needlessly. I solved the whole damn thing by running a cron job:
>> "cd /var/spool/news/ ; rm *" every 15 minutes will do the job
>> nicely. :)
>
>The problem is that the directory file itself (not the content) gets
>big. So erasing control/cancel/* may not help. It's better to erase -rf
>control.cancel and let inn remake the cancel directory.
Removing the entire contents of the directory is not the answer. This
drastically impairs propogation of cancels to sites you feed articles to.
I run the following perl code every 15 minutes to purge all articles older
than 30 minutes. This keeps the article count down while still giving my
peers a 30 minute window to get their peering act together if something is
slow. Adjust times to suite your taste.
This code was borrowed from someone else; I can't remember who (sorry).
--- SNIP ---
#!/usr/bin/perl
$directory = "/var/news/spool/articles/control/cancel";
$now = time;
chdir $directory;
opendir (DIR, ".");
FILE: while ($file = readdir DIR) {
next FILE if ($file !~ /^\d+/);
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,
$mtime,$ctime,$blksize,$blocks) = stat $file;
$age = $now - $mtime;
unlink ($file) if ($age > 1800);
}
closedir DIR;
unlink(".overview");
--- SNIP ---
Change $directory accordingly. Before running this the first time, blow
away the entire .../control/cancel directory as suggested by Stephan
(above).
Andy Neely
System Administrator
Front Range Internet, Inc.
Technical Details
Message-ID:
<neely-1912971624040001@news.frii.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<67413d$4tk$1@coredump.ucs.indiana.edu> <675uia$bkv@layla.RoBIN.de> <677klh$nv9$1@server3.mich.com> <349A4408.AB2F05F@skynet.be>Show Full Headers
Complete Article Headers
Message-ID: <neely-1912971624040001@news.frii.com> Subject: Re: Inn 1.7.2/Linux high CPU usage Date: Fri, 19 Dec 1997 00:00:00 +0000 From: neely@frii.net (Andrew Neely) References: <67413d$4tk$1@coredump.ucs.indiana.edu> <675uia$bkv@layla.RoBIN.de> <677klh$nv9$1@server3.mich.com> <349A4408.AB2F05F@skynet.be> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 308706391 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=ISO-8859-1 Organization: Front Range Internet, Inc. Mime-Version: 1.0 Newsgroups: news.software.nntp