🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
8 messages
8 total messages Started by Marcus Needham Tue, 19 Aug 1997 00:00
What affects innd's memory size at equilibrium and why may it change dramatically?
#20674
Author: Marcus Needham
Date: Tue, 19 Aug 1997 00:00
20 lines
1451 bytes
For the last few months my innd process (1.5.1 [with newer nnrpd], 
history cache (without memory leak) and some other minor patches, BSD/OS V2.1) 
has reached an equilibrium size of about 75MB (VSS) and will stay there for 
weeks. In the past week or so though it has 
a) been reaching a stable point at around 90MB or even 110MB
b) suddenly growing to 178MB (at which point I kill it and watch it grow 
again).

I have not made any changes to this system that I could account for it with.  
I purge my control.cancel directory every hour to keep it small, and 
clear out the *.jobs.* groups once a day.  I use innfeed 0.10.1 to feed my 
peers, could backlogging be causing buffer usage in innd to grow perhaps?

Any ideas?

// Marcus Needham      // Internet Operations Manager, The River Internet
\\ marcus@theriver.com \\ Access Co., Tucson AZ. http://www.theriver.com/

Re: What affects innd's memory size at equilibrium and why may it change dramatically?
#20719
Author: Kachun Lee
Date: Wed, 20 Aug 1997 00:00
40 lines
2175 bytes
In article <5tf4fn$852$1@news.theriver.com>, marcus@theriver.com says...
>
>In article <5tdj2g$m2l$1@news1.epix.net>, mibsoft@epix.net (Forrest J. 
Cavalier III) wrote:
>>Did you have a look at INN FAQ 7.33?  "INN gets real big"
>>http://www.mibsoftware.com/userkt/inn/faq7/0051.htm
>
>Already had ;-(
>
>>Spam + spam cancels have been inflating history files lately,
>>which will inflate what is pulled in for dbz.  
>
>Certainly my history.pag gets quite large towards the end of the day even 
>though I keep /remember/ small (6 right now).  I will try a twice daily 
>expire and see what effect that has.
>
>>Are you sure overchan is not backlogging?
>
>I do not think so (I see no batches in out.going for it) but I will turn it 
>off for a short while and see what happens.
>
>Last night it grew to 150MB then failed and exited trying to grab another 
>chunk:
>Aug 20 06:46:34 news innd: SERVER cant remalloc 67110144 bytes Cannot 
>allocate memory

67+M BUFFER! I also suspect one of your channel feeds are not keeping up. If it 
is not overchan, the others common ones are crosspost or innfeed (look for Tc 
in your newsfeeds file). I would let your innd run for several hours and do 
'ctlinnd flush <channel>' on each of your channel and see which one write a 
backlog file in your out.going directory and go from there.

>Ring any bells?
>
>// Marcus Needham      // Internet Operations Manager, The River Internet
>\\ marcus@theriver.com \\ Access Co., Tucson AZ. http://www.theriver.com/


Re: What affects innd's memory size at equilibrium and why may it change dramatically?
#20721
Author: Marcus Needham
Date: Wed, 20 Aug 1997 00:00
22 lines
1797 bytes
In article <5tf996$8na$1@news.theriver.com>, marcus@theriver.com (Marcus Needham) wrote:
>In article <Pine.LNX.3.96.970820182241.6999D-100000@marley.vszbr.cz>, 
>ag786@yfn.ysu.edu wrote:
>...
>>    Eh?  Your history.pag file should stay constant in size.  If it
>>increases in size throughout the day, something has happened so that the
>>makehistory (which rebuilds the history.pag file) isn't happening.
>
>I may have faulty memory. I recalled history.pag being bigger prior
>to last night's expiry than it is now (33MB) but I will keep a proper eye
>on it today.

Well no, it has in fact grown since I said the above, its now 39MB.  I 
consulted the FAQ and found nothing pertinent.  Expire uses the old size to 
create the new one internally (does not use makehistory), right?  So it 
should be creating a suitably sized one based on the size of the prior one.

// Marcus Needham      // Internet Operations Manager, The River Internet
\\ marcus@theriver.com \\ Access Co., Tucson AZ. http://www.theriver.com/

Re: What affects innd's memory size at equilibrium and why may it change dramatically?
#20729
Author: Marcus Needham
Date: Wed, 20 Aug 1997 00:00
54 lines
2685 bytes
In article <Pine.LNX.3.96.970820182241.6999D-100000@marley.vszbr.cz>, 
ag786@yfn.ysu.edu wrote:
..
>    Eh?  Your history.pag file should stay constant in size.  If it
>increases in size throughout the day, something has happened so that the
>makehistory (which rebuilds the history.pag file) isn't happening.

I may have faulty memory. I recalled history.pag being bigger prior
to last night's expiry than it is now (33MB) but I will keep a proper eye
on it today.

..
>Divide the size of your history.pag file by 4 (if you haven't hacked the
>DBZ code) and that should be the third entry in your history.dir file...
>dbz 3 1350001 9 C 32 31 26 4 3 2 1 0
>812834 0 0 0 0 0 0 0 0 0 0
>....which should be a bit more than 150% of the first number you see in the
>second line of your history.dir file, which is the actual number of
>entries in the history test file.  

Mine matche these criteria.  My 3rd entry is 8405977 which matches 
(size of history.pag)/4, and is 180% of the 1st entry on the 2nd line.

..
>Further, take a look
>at the 8th field in the history.dir file, in my case 26, and verify that
>the actual size of the history text file is not greater than 2^(this
>number).  

Mine is 29, and 2^29=536MB is comfortably bigger than history currently is 
(260MB). 

..
>> Last night it grew to 150MB then failed and exited trying to grab another 

>> chunk:
>> Aug 20 06:46:34 news innd: SERVER cant remalloc 67110144 bytes Cannot 
>> allocate memory
>> 
>> Ring any bells?
>
>    Sure.  Added any patches?  Certain ones result in memory leaks...

Only idle-timer and history-cache are currently in, and the latter was 
fixed for the memory leak problem (innd size stayed stable for weeks prior 
to this recent problem).

Appreciate the info.

// Marcus Needham      // Internet Operations Manager, The River Internet
\\ marcus@theriver.com \\ Access Co., Tucson AZ. http://www.theriver.com/

Re: What affects innd's memory size at equilibrium and why may it change dramatically?
#20737
Author: Marc Slemko
Date: Wed, 20 Aug 1997 00:00
114 lines
5081 bytes
In <5tf4fn$852$1@news.theriver.com> marcus@theriver.com (Marcus Needham) writes:

>>Are you sure overchan is not backlogging?

>I do not think so (I see no batches in out.going for it) but I will turn it 
>off for a short while and see what happens.

>Last night it grew to 150MB then failed and exited trying to grab another 
>chunk:
>Aug 20 06:46:34 news innd: SERVER cant remalloc 67110144 bytes Cannot 
>allocate memory

>Ring any bells?

You could try the following two patches.  The second will tell you
where (ie. source file and line number) innd is trying to remalloc
from.  I found that my overchan channel was growing huge, even
though there wasn't much data left in it.  eg.  30 meg buffer, 20k
of data in it.

The first patch fixes some of that.  First, it allocates the buffer
in chunks of at least 64k instead of the default 1k.  If you don't
change this, innd does a horrible number of remalloc()s.  It also
means you get 64 times more debug messages from the second patch.
The other thing the first patch does is attempt to compact
the buffer instead of allocating more memory.  This helped a _lot_
for some buffers.

You should apply Jerry Aguirre's overchan backlog patch 
(in ftp://ftp.isc.org/isc/inn/unoff-patches/1.5.1/ with a 
name of innd-fix-for-overchan-backlogs.patch) if it isn't
in the version you are using.  Even with it, however, my
channel buffers were still growing far larger than necessary.

Oh, to get the below change to macros.h to compile with all the
source files (ie. not just innd) you have to add a bunch of #include
<syslog.h>s around.

If, as you say in another post, your history.pag file is growing
a lot then you have other problems... Barry gives details in his
post.

Index: innd.h
===================================================================
RCS file: /home/marcs/cvs/inn/innd/innd.h,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 innd.h
*** innd.h	1997/07/13 05:32:48	1.1.1.1
--- innd.h	1997/08/18 22:58:34
***************
*** 339,347 ****
  	    /* Note end of buffer, grow it if we need more room. */ \
  	    i_ = bp_->Used + bp_->Left; \
  	    if (i_ + l_ > bp_->Size) { \
! 		/* Round size up to next 1K. */ \
! 		bp_->Size += (l_ + 0x3FF) & ~0x3FF; \
! 		RENEW(bp_->Data, char, bp_->Size); \
  	    } \
  	    bp_->Left += l_; \
  	    if (l_ > MEMCPY_THRESHOLD) \
--- 343,362 ----
  	    /* Note end of buffer, grow it if we need more room. */ \
  	    i_ = bp_->Used + bp_->Left; \
  	    if (i_ + l_ > bp_->Size) { \
! 	        if ( (bp_->Used > (bp_->Size/10)) && (bp_->Used > 256*1024)) { \
! 		    /* compact the buffer, shoving the \
! 		       data back to the beginning. \
! 		       <rmtodd@mailhost.ecn.ou.edu> */ \
! 		    syslog(L_NOTICE, "DEBUG: innd.h: about to shrink buffer, bp_->Used = %d, bp_->Left = %d, bp_->Size = %d", bp_->Used, bp_->Left, bp_->Size); \
! 		    BUFFset(bp_, &bp_->Data[bp_->Used], bp_->Left); \
! 		    syslog(L_NOTICE, "DEBUG: innd.h: finished shrinking buffer, bp_->Used = %d, bp_->Left = %d, bp_->Size = %d", bp_->Used, bp_->Left, bp_->Size); \
! 		    i_ = bp_->Used + bp_->Left; \
! 		} \
! 		if (i_ + l_ > bp_->Size) { \
! 		    /* Round size up to next 64k. */ \
! 		    bp_->Size += (l_ + 0xFFFF) & ~0xFFFF; \
! 		    RENEW(bp_->Data, char, bp_->Size); \
! 		} \
  	    } \
  	    bp_->Left += l_; \
  	    if (l_ > MEMCPY_THRESHOLD) \



Index: macros.h
===================================================================
RCS file: /home/marcs/cvs/inn/include/macros.h,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 macros.h
*** macros.h	1997/07/13 05:32:44	1.1.1.1
--- macros.h	1997/08/18 22:47:31
***************
*** 27,33 ****
  	((T *)xmalloc((unsigned int)(sizeof (T) * (c))))
  
  #define RENEW(p, T, c)			\
!         (p = (T *)xrealloc((char *)(p), (unsigned int)(sizeof (T) * (c))))
  
  /* =()<#define DISPOSE(p)		free((@<POINTER>@ *)p)>()= */
  #define DISPOSE(p)		free((void *)p)
--- 27,36 ----
  	((T *)xmalloc((unsigned int)(sizeof (T) * (c))))
  
  #define RENEW(p, T, c)			\
! { \
!     syslog(LOG_NOTICE, "RENEW: %s:%d: trying to realloc %d bytes", __FILE__, __LINE__, c); \
!     (p = (T *)xrealloc((char *)(p), (unsigned int)(sizeof (T) * (c)))); \
! }
  
  /* =()<#define DISPOSE(p)		free((@<POINTER>@ *)p)>()= */
  #define DISPOSE(p)		free((void *)p)

Re: What affects innd's memory size at equilibrium and why may it change dramatically?
#20744
Author: Marcus Needham
Date: Wed, 20 Aug 1997 00:00
30 lines
1689 bytes
In article <5tdj2g$m2l$1@news1.epix.net>, mibsoft@epix.net (Forrest J. Cavalier III) wrote:
>Did you have a look at INN FAQ 7.33?  "INN gets real big"
>http://www.mibsoftware.com/userkt/inn/faq7/0051.htm

Already had ;-(

>Spam + spam cancels have been inflating history files lately,
>which will inflate what is pulled in for dbz.  

Certainly my history.pag gets quite large towards the end of the day even 
though I keep /remember/ small (6 right now).  I will try a twice daily 
expire and see what effect that has.

>Are you sure overchan is not backlogging?

I do not think so (I see no batches in out.going for it) but I will turn it 
off for a short while and see what happens.

Last night it grew to 150MB then failed and exited trying to grab another 
chunk:
Aug 20 06:46:34 news innd: SERVER cant remalloc 67110144 bytes Cannot 
allocate memory

Ring any bells?

// Marcus Needham      // Internet Operations Manager, The River Internet
\\ marcus@theriver.com \\ Access Co., Tucson AZ. http://www.theriver.com/

Re: What affects innd's memory size at equilibrium and why may it change dramatically?
#20754
Author: Forrest J. Cavalier III
Date: Wed, 20 Aug 1997 00:00
34 lines
1862 bytes
e-mailed and posted

In article <5tcnc0$j4u$1@news.theriver.com>, marcus@theriver.com wrote...
>
>For the last few months my innd process (1.5.1 [with newer nnrpd], 
>history cache (without memory leak) and some other minor patches, BSD/OS V2.1) 
>has reached an equilibrium size of about 75MB (VSS) and will stay there for 
>weeks. In the past week or so though it has 
>a) been reaching a stable point at around 90MB or even 110MB
>b) suddenly growing to 178MB (at which point I kill it and watch it grow 
>again).
>
>I have not made any changes to this system that I could account for it with.  
>I purge my control.cancel directory every hour to keep it small, and 
>clear out the *.jobs.* groups once a day.  I use innfeed 0.10.1 to feed my 
>peers, could backlogging be causing buffer usage in innd to grow perhaps?
>
>Any ideas?

Did you have a look at INN FAQ 7.33?  "INN gets real big"

http://www.mibsoftware.com/userkt/inn/faq7/0051.htm

Spam + spam cancels have been inflating history files lately,
which will inflate what is pulled in for dbz.  

Are you sure overchan is not backlogging?

Forrest Cavalier, Mib Software, INN customization and consulting
Commercial support for INN: http://www.mibsoftware.com/innsup.htm


Re: What affects innd's memory size at equilibrium and why may it change dramatically?
#20765
Author: Barry BOFHwsma
Date: Thu, 21 Aug 1997 00:00
93 lines
5311 bytes
On Wed, 20 Aug 1997, Marcus Needham wrote:

> >    Eh?  Your history.pag file should stay constant in size.  If it
> >increases in size throughout the day, something has happened so that the
> >makehistory (which rebuilds the history.pag file) isn't happening.
> 
> I may have faulty memory. I recalled history.pag being bigger prior
> to last night's expiry than it is now (33MB) but I will keep a proper eye

    Well.  As I got in this morning, killed off the looping innfeed
(taking INN with it), and restarted the mess, I took a look at my disk
space usage and file sizes, and what do I see today?

-rw-rw-r--   1 barry    62011286 Aug 21 09:13 /usr/local/etc/innd/history
-rw-rw-r--   1 barry          64 Aug 21 09:13 /usr/local/etc/innd/history.dir
-rw-rw-r--   1 barry     8229052 Aug 21 09:13 /usr/local/etc/innd/history.pag

    Ahem.  Something not be right...

more /usr/local/etc/innd/history.dir
dbz 3 1350001 9 C 32 31 26 4 3 2 1 0
858794 0 0 0 0 0 0 0 0 0 0

    So, as you see, *I* have a problem.  I am by no means a whiz about the
history database; in fact, I would claim to know nothing about it.  But
something has broken somewhere for me.  Someone who knows more about DBZ
would be able to explain why it has started to use space outside of the
original database.

    In the past, when I've been scouring logs, I've seen error messages
that have been caused by malformed Message-ID: headers (continuations, and
whatnot).  As I have a handful of sites feeding me which are not using INN
and have been known to send articles in the past which are broken by the
RFCs, I should check to see if this has happened again.

    Unfortunately, a quick scan reveals only the usual problems...


> >at the 8th field in the history.dir file, in my case 26, and verify that
> >the actual size of the history text file is not greater than 2^(this
> >number).  
> 
> Mine is 29, and 2^29=536MB is comfortably bigger than history currently is 
> (260MB). 

    However, unless you've applied some sort of hackery, your history
lookups are more painful than they need to be, and in any case, rather
painful and robbing you of performance.

    If 2^29 is 536M (bc is broken here and I'm lazy), 2^28 would be
adequate to keep a 268MB text file mapped into the .pag file.  What will
happen if the size of the text file exceeds 268MB is that rather than
consult the .pag database file, one will have to read through the history
text file in search of entries beyond the 268M mark.  This is fine if
you're a handful of megs over this size, but isn't so good for a text file
twice as large.

    What do you get from having 28 rather than 29 in this field?  That
means one more bit is available to be used by the DBZ routine to make
history searches more efficient.  When your text file is around the half
gig mark in size, your history lookups are resulting in a lot of hits on
the text file to verify if things match or not.  I really don't have any
numbers, but I noticed a huge difference after applying Joe Greco's patch
for 64-bit indexing that virtually eliminates all these hits by reducing
them to a single hit, or a guaranteed miss.

    What will happen is that by the time expire rolls around again, your
text file will have slightly overstepped the power-of-two boundary and the
new database will be calculated at the somewhat less efficient size.
You'll see some performance increase if you can keep this from happening.
That's why I'm concerned by the 67M mark with my fractional newsfeed.

    You should be able to tune your remember time as well as your group
retention times to stay under this boundary without terribly affecting
your lusership.  If you post parts of your expire.ctl file, other people
can give you tips.  At least, you could drop remember from 6 to 5.5
without having to adjust hierarchy expirations.  If any hierarchy is
stored more than 5 days, you could prune higher-traffic groups back a bit.

    Then next week, spam traffic will have increased further, wiping out
the improvements you've so painfully carved out #&^(@^#!{>/!!!

    (Other minor tuning of the history file, like shortening paths and
removing bogus groups, will also reduce space taken up, but this minor
tuning involves major surgery elsewhere)


Barry Bouwsma, Newsbozo, Mendel University, Brno, CZ
argh, flat tires, looping innfeed, dying innd, my life is in ruins


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