🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #32638

new/rmgroup wrapper to keep load down

#32638
From: Danny Rathjens
Date: Fri, 30 Oct 1998 00:00
36 lines
2046 bytes
I wrote this wrapper so that my load average doesn't shoot up to around
50 when I get a bunch of newgroup control messages.  It basically just
processes the first one then sleeps 10 minutes waiting for any others
to arrive putting them all in a queue, then processes everything in the
queue in order, rather than concurrently which is what it did previously
to bloat my loadavg.  I know it's rather kludgy.  I am hoping to get some
suggestions on how to do this better.

#!/bin/sh
#newgroup_wrapper to keep load down
#last modified 103098 by Danny Rathjens
if [ ! -d /tmp/news ]; then
  mkdir /tmp/news
fi
if [ -f /tmp/news/newgroup.LOCK ]; then
  echo $* >/tmp/news/ng${$}  
else  
  :>/tmp/news/newgroup.LOCK
  /depot/inn-2.0/bin/control/newgroup.orig $*
  sleep 600
  q=`/bin/ls -1t /tmp/news/ng* 2>/dev/null | head -1`
  while [ -n "${q}" ]; do
    /depot/inn-2.0/bin/control/newgroup.orig `cat /tmp/news/${q}`
    rm -rf /tmp/news/${q} 2>/dev/null
    q=`/bin/ls -1t /tmp/news/ng* 2>/dev/null | head -1`
  done
  rm -rf /tmp/news/newgroup.LOCK 2>/dev/null
fi


and rmgroup wrapper is same except for the obvious changes.
-- 
"We all declare for liberty, but in using the same word we do not all mean
the same thing."   --  A. Lincoln

Technical Details
Message-ID: <363A4D7B.195ACA55@cs.fiu.edu>
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

Show Full Headers
Complete Article Headers
Message-ID: <363A4D7B.195ACA55@cs.fiu.edu>
Subject: new/rmgroup wrapper to keep load down
Date: Fri, 30 Oct 1998 00:00:00 +0000
From: Danny Rathjens <dkr@cs.fiu.edu>
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: 406844639
Content-Transfer-Encoding: 7bit
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: usenet@cs.fiu.edu
X-Trace: mustang.cs.fiu.edu 909790590 27913 131.94.133.2 (30 Oct 1998 23:36:30 GMT)
Organization: FIU-SCS-USG
Mime-Version: 1.0
NNTP-Posting-Date: 30 Oct 1998 23:36:30 GMT
Newsgroups: news.software.nntp