🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
7 messages
7 total messages Started by nils mccarthy Sun, 22 Sep 1996 00:00
patch to show INN idle time
#11058
Author: nils mccarthy
Date: Sun, 22 Sep 1996 00:00
68 lines
2899 bytes
A couple of my feeds have requested this code after I mentioned its
existance to them, so I thought that perhaps the world in general
would find this of use.  This is a patch that reports to news.notice
every 5 minutes telling how much time INN is spending waiting for
network I/O (and thus has nothing it's working on), as opposed to
processing articles, writing them to disk, and sending their
information to outgoing feeds.

My assessment of the situation is that if the idle time reads near or
at 0, then feeding sites will probably be falling behind.  Here, idle
time usually ranges between 50 and 150 out of 300.  I'm interested in
other sites' experiences.

I mostly use an in-house news log analyser, so I don't have a patch to
get either innlog to recognize and summarize these messages.  Sorry.

Enjoy,

-nils

===================================================================
--- innd/chan.c	1996/09/18 09:38:58	1.1.1.1
+++ innd/chan.c	1996/09/23 05:37:38
@@ -714,6 +714,13 @@
     struct timeval	MyTime;
     long		silence;
     char		*p;
+    static struct timeval total_time_used;
+    static time_t last_checkpoint_time;
+    struct timeval before_select, after_select;
+
+    time(&last_checkpoint_time);
+    total_time_used.tv_sec = 0;
+    total_time_used.tv_usec = 0;
 
     for ( ; ; ) {
 	/* See if any processes died. */
@@ -723,8 +730,27 @@
 	MyRead = RCHANmask;
 	MyWrite = WCHANmask;
 	MyTime = TimeOut;
+	gettimeofday(&before_select, NULL);
 	count = select(CHANlastfd + 1, &MyRead, &MyWrite, (FDSET *)NULL,
 		&MyTime);
+	gettimeofday(&after_select, NULL);
+	
+	total_time_used.tv_sec += after_select.tv_sec - before_select.tv_sec;
+	total_time_used.tv_usec += after_select.tv_usec + 1000000
+	  - before_select.tv_usec;
+	while (total_time_used.tv_usec > 1000000) {
+	  total_time_used.tv_usec -= 1000000;
+	  total_time_used.tv_sec ++;
+	}
+	total_time_used.tv_sec--;
+	
+	if (after_select.tv_sec >= (last_checkpoint_time+300)) {
+	  syslog(L_NOTICE, "ME seconds %d idle %d",
+		 after_select.tv_sec - last_checkpoint_time,
+		 total_time_used.tv_sec);
+	  total_time_used.tv_sec = 0;
+	  last_checkpoint_time = after_select.tv_sec;
+	}
 	if (GotTerminate) {
 	    (void)write(2, EXITING, STRLEN(EXITING));
 	    CleanupAndExit(0, "received signal");

Re: patch to show INN idle time
#11534
Author: Joe Greco
Date: Wed, 09 Oct 1996 00:00
43 lines
2530 bytes
In news.software.nntp article <5259lv$s6n@nnrp1.news.primenet.com>, nils mccarthy <nils@primenet.com> wrote:
:A couple of my feeds have requested this code after I mentioned its
:existance to them, so I thought that perhaps the world in general
:would find this of use.  This is a patch that reports to news.notice
:every 5 minutes telling how much time INN is spending waiting for
:network I/O (and thus has nothing it's working on), as opposed to
:processing articles, writing them to disk, and sending their
:information to outgoing feeds.

Nice patch, Nils.

However... a little frustrating because all it tells you is what you 
already know: you either have idle time and your performance doesn't
stink, or you don't have idle time and your performance does stink.

I have a patch here that expands upon this idea, and I will hopefully
be releasing it by the end of the week.  It produces log reports such
as

Oct  9 11:39:25 news innd: ME time 300097 idle 196062(9493) artwrite 65207(1009) artlink 11(339) hiswrite 6879(1009) hissync 2(16) sitesend 232(5320) artctrl 0(17) artcncl 0(1) hishave 6145(8876) 

(times in milliseconds, numbers in parens are number of invocations).  This
can be parsed up into very useful data:

Percent busy:        (300097 - 196062) / 300097 = 35%
Time per article write:          65207 /   1009 = 64 ms
Percent time spent writing art:  65207 / 300097 = 21%
Time per crosslink:                 11 /    339 = 0 ms
Percent time spent crosslink:       11 / 300097 = 0%
Time per history write:           6879 /   1009 = 7 ms
Percent time spent writing his:   6879 / 300097 = 2%
Time per history lookup:          6145 /   8876 = 1 ms
Percent time spent hist lookup:   6145 / 300097 = 2%

This is a pretty fast news server, although it appears that it could use
some work on the spool itself to make article writes happen faster.

"Anyone interested?"

... JG

Re: patch to show INN idle time
#11538
Author: Eilon Gishri
Date: Wed, 09 Oct 1996 00:00
30 lines
1824 bytes
Joe Greco <jgreco@brasil.moneng.mei.com> wrote:

: "Anyone interested?"

: ... JG

Sure.

-- 
+--------------------------------------------------------------------+
| Eilon Gishri                              Unix System Administrator|
| I.B.M. Israel                                      Internet Project|
| 2, Weizmann St.                Tel-Aviv 64239                ISRAEL|
| Fax   : +972-3-6978115                        Phone: +972-3-6978802| 
| E-Mail: eilon@ibm.net.il                                           |
+--------------------------------------------------------------------+
IBM Israel
2, Weizmann St.
Tel Aviv 61336                         ======   =======    ===     ===
http://www.ibm.net.il/                 ======   ========   ====   ====
Dialup registration:   177-022-3993      ==      ==   ==    ==== ====
Company services:        03-6978663      ==      ======     == === ==
Internet sales fax:      03-6978115      ==      ==  ===    ==  =  ==
Enquiries:          info@ibm.net.il    ======   ========   ===     ===
Technical support:   noc@ibm.net.il    ======   =======    ===     ===
----------------------------------------------------------------------


Re: patch to show INN idle time
#11541
Author: Joe Greco
Date: Wed, 09 Oct 1996 00:00
32 lines
2170 bytes
In article <53h681$ilj@netra.socialaw.com>,
Rodney C. Marable <rmarable@socialaw.com> wrote:
>In article <53gsj0$8rm@news.ibm.net.il>, eilon@ibm.net.il says...
>>
>>Joe Greco <jgreco@brasil.moneng.mei.com> wrote:
>>
>
>Hmmm... I'd be interested in it, but I would really like to find out if 
>someone has a tool/patch that will give information as to how much INN may 
>or may not be slowing the rest of the machine down.

Well it should be immediately obvious how to determine what the CPU hit
is...  but that's never the real problem on a news system (or shouldn't
be).  Measuring the additional latency caused by I/O system contention
is rather tricky and maybe is best measured by trying it both ways.

If all that was running was INN itself (no feeds, no overchan, no crosspost,
no nnrpd's, etc) then the "idle" measure provided by my patch might actually
be useful.  The subsections generally are timing I/O system latency, and/or
total time spent doing I/O activities, either of which would be useful
numbers to know when trying to figure out what you want to know.  The
latency numbers might actually be useful regardless of feeds/nnrpd's/etc.

However, it's been close to half a decade now since I've run news on
anything but a dedicated system.  I contend that if you have to worry
about news slowing other things down, you have made an engineering error
and should consider offloading news onto a different box.

... JG

Re: patch to show INN idle time
#11551
Author: Rodney C. Marable
Date: Wed, 09 Oct 1996 00:00
17 lines
1215 bytes
In article <53gsj0$8rm@news.ibm.net.il>, eilon@ibm.net.il says...
>
>Joe Greco <jgreco@brasil.moneng.mei.com> wrote:
>

Hmmm... I'd be interested in it, but I would really like to find out if 
someone has a tool/patch that will give information as to how much INN may 
or may not be slowing the rest of the machine down.

-- 
| Rodney C. Marable           | Email: <marable@socialaw.com>          |
| Associate Computer Engineer | Phone: 617.523.0018 x377               |
| Social Law Library          | "You didn't think I'd let that slide." |


Re: patch to show INN idle time
#11559
Author: Chrisy Luke
Date: Thu, 10 Oct 1996 00:00
21 lines
1527 bytes
On 9 Oct 1996 21:42:25 GMT, rmarable@socialaw.com (Rodney C. Marable)
wrote:
>Hmmm... I'd be interested in it, but I would really like to find out if 
>someone has a tool/patch that will give information as to how much INN may 
>or may not be slowing the rest of the machine down.

"ps" should tell you all you need to know, with maybe "iostat" or
"systat" if your system has it. :)

I'm on for that patch. I should be able to tie it in easily enough
with some graphing tools I'm developing.

Chris.

== chrisy@easynet.net, chrisy@flirble.org.uk, chrisy@etsiig.uniovi.es
== Newsmaster and Senior Systems Developer for Easynet Group Plc.
== To Flirble or not to Flirble? That is not a question, but a
== statement of being, of life and of survival.

Re: patch to show INN idle time
#11577
Author: Tim Hogard
Date: Thu, 10 Oct 1996 00:00
46 lines
2655 bytes
Joe Greco (jgreco@ns.sol.net) wrote:
: In article <53h681$ilj@netra.socialaw.com>,
: Rodney C. Marable <rmarable@socialaw.com> wrote:
: >In article <53gsj0$8rm@news.ibm.net.il>, eilon@ibm.net.il says...
: >>
: >>Joe Greco <jgreco@brasil.moneng.mei.com> wrote:
: >>
: >
: >Hmmm... I'd be interested in it, but I would really like to find out if 
: >someone has a tool/patch that will give information as to how much INN may 
: >or may not be slowing the rest of the machine down.

...
: However, it's been close to half a decade now since I've run news on
: anything but a dedicated system.  I contend that if you have to worry
: about news slowing other things down, you have made an engineering error
: and should consider offloading news onto a different box.
Some of us only have one machine to run new on :-(

I think that any status should be done via the ctlinnd interface.  It's
very clean and allows for transfering 4K of info between Innd and anything
else quickly and efficently.  It's even easy to use too.

If your running apache and Inn on the same box and are not worried about them
using the same group, I have an apache module that basicly does a 
"ctlinnd mode" to inn.  While this isn't too useful (I need something
to be my first apache module) it could be extended.  I keep hearing
that inn is a pain to mangage since it doesn't have a gui, well
this (and the above patches) could be a start to soemthing useful.

You can see this in action at:
http://www.abnormal.com/inn

And source code can be found at:
ftp://www.abnormal.com/pub/apache/mod_inn.c

I spent about two hours on this module and I'm impressed with Rich $alz
desing of Inn and the Apache groups work as well.  It's good stuff.


-tim                                           http://www.abnormal.com
"If you want to drive the Information Superhighway, don't buy a boat."
      -- Eric@exile.org about someone buying cc:Mail for internet mail

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