Thread View: news.software.nntp
2 messages
2 total messages
Started by Danny Rathjens
Fri, 30 Oct 1998 00:00
new/rmgroup wrapper to keep load down
Author: Danny Rathjens
Date: Fri, 30 Oct 1998 00:00
Date: Fri, 30 Oct 1998 00:00
36 lines
2046 bytes
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
Re: new/rmgroup wrapper to keep load down
Author: Andrew Gierth
Date: Sat, 31 Oct 1998 00:00
Date: Sat, 31 Oct 1998 00:00
18 lines
1469 bytes
1469 bytes
>>>>> "Danny" == Danny Rathjens <dkr@cs.fiu.edu> writes: Danny> I wrote this wrapper so that my load average doesn't shoot up Danny> to around 50 when I get a bunch of newgroup control messages. Danny> It basically just processes the first one then sleeps 10 Danny> minutes waiting for any others to arrive putting them all in a Danny> queue, then processes everything in the queue in order, rather Danny> than concurrently which is what it did previously to bloat my Danny> loadavg. I know it's rather kludgy. I am hoping to get some Danny> suggestions on how to do this better. See Fluffy's control channel, should be available from http://www.deathsdoor.com/meowing -- Andrew.
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