🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #11313

INND dies after growing 5-8Meg/hour even with innd malloc

#11313
From: Frank Durda IV
Date: Wed, 02 Oct 1996 00:00
107 lines
7141 bytes
I am new to this newsgroup and this may have been discussed repeatedly, so I apologize
up front.    (I have read the FAQs and the provided advice did not solve the problem.)
Also, I am somewhat new to INN, but have used Cnews for years, so forgive any misuse of
terminology.

I have recently been given the task of "fixing" a INN 1.4unoff4 system that is having problems.
The original problem was that it was just being slow until its former keepers upgraded the
system, OS and recompiled INN all or about the same time.   Things have been bad since.

The system as it stands now is a Dec Alpha with multiple processors running OSF 4.0.
Previously it had fewer (still multiple) processors and was running OSF 3.1.   It has
a DEC Raid box configured for mirroring where the history and associated logs are kept.
The actual NEWS spool is NFS mounted on a remote system with lots of disk space.   The
system is configured so that a different system is responsible for providing services
to users reading news.  This system only handles incoming news from all sources and
NNTP links out to other systems.   This is a large news system; the history file is 373Meg
right now and we keep non alt.binary things for about 14 days.   It shouldn't matter
for this but /usr/local/news and /history are on different drives, although this broke
news.daily/expire.


The first problem we noticed is that innd was taking incredible amounts of time to decide that
it had already seen a given article, on the order of 40 to 75 seconds.  If you simply did
	telnet system nntp
and pasted the headers of a previous posting in there so you knew it would have a duplicate
ID, it would go away for a minute or so, and then report "Duplicate".  With 10+ major feeds and
hundreds of individual newsreaders trying to post ant any instant, this is a problem.

A related problem is that the time to get an initial ack from innd can also take 30 or 40 seconds.
This is even with the addition of another 300MHz processor to the system.

Because of this, we tried what I call the "tuning patch" from Alan Barret that tinkers
with priority in the main loop.  We put this in and it seems to help slightly, but our
latencies on rejecting duplicates are still enormous.  It seems the rejection of a post
with a duplicate message ID should be at least as fast as a query as to whether a given 
message ID is available for downloading, and that query responds in less than a second.

Anyway, as we tried to guage the improvement of this patch, we noticed a new problem
that had not been seen before the universe changed:

The largest problem is that innd dies regularly with ME cant remalloc %d bytes Not enough
space.   I have looked in the FAQ and found an entry for getting this error with values like
8192 bytes for HP systems.  However, my numbers are somewhat larger:

Sep 27 13:59:57 news-f innd: ME cant remalloc 3589376 bytes Not enough space
Sep 27 20:09:32 news-f innd: ME cant remalloc 3587328 bytes Not enough space
Sep 28 06:36:11 news-f innd: ME cant remalloc 4483328 bytes Not enough space
Sep 28 13:52:34 news-f innd: ME cant remalloc 3587328 bytes Not enough space
Sep 28 22:15:00 news-f innd: ME cant remalloc 4483328 bytes Not enough space
Sep 29 15:03:45 news-f innd: ME cant remalloc 8388864 bytes Not enough space
Oct  2 04:35:17 news-f innd: ME cant remalloc 8388864 bytes Not enough space

The first thing I did was pull the tuning patch.  This seemed to slow the rate of death,
but I could watch innd grow by the minute, adding 5 Meg per hour to its VSZ and RSS
sizes.  The other disturbing thing was innd would be at 108M/91M only seconds after
being started, and would continue to grow 5Meg/hour until it died.   I have seen it
as large as 141M/127M before it died.   

I suspect that pulling the patch simply reduced the number of articles processed per
hour and reduced the leak rate (or whatever it is) that way, rather than there actually
being a leak in the priority patch code.


Despite the fact that the FAQ suggestion for the ME cant remalloc were directed at
HPUX users and for considerably smaller remalloc attempts, I switched innd to use the
inn malloc (which I assume you do by adding it to the MISSING_SRC/MISSING_OBJ lines
in the Makefile).

	(Note to the FAQ maintainer - the FAQ suggests in several places using
	the provided malloc but nowhere does it say what you do to do this.)

Anyway, I rebuilt with internal malloc (and nm seems to bear that it has one inside now),
and restarted innd.  The first change I noted was that the initial sizes were like 14M/10M,
but it continued to grow at 6 to 8Meg per hour (faster than before), and would eventually die.
Despite the lower starting value, the faster growth rate made the amount of time it takes to die
nearly identical as with the system malloc.   (Once this internal malloc version started at
114M/109M for no apparent reason, although expire had been running when it died and when it was
restarted.  Shut it down again and restarted and it came back in the teens as before.)   At this
point, the tuning/priority patch is NOT present.


Now I started looking at other things.  I noted that MMAP was disabled (it is broken in OSF
according to the people I have talked to), but INCORE was turned on, which I was also advised to
turn off.  I did this but discovered that in the dbz code a test forces INCORE back on
"because it is such a great performance win" even if you explicitly disable it.  So I shut
that override off and rebuilt.  This had little or no effect and innd still grows and dies
over time.

I also looked into whether I was hitting a system resource.  OSF sh doesn't have a ulimit
command, and everything in inn scriptwise seems to assume sh.  I asked the kernel
directly what the max data size allowed and ulimit(UL_GETBREAK) reported 0x40000000, so I don't
think that is the problem.

So, I'm looking for ideas on how to fix what appears to be a significant memory leak or
at least determine what the cause is.   I am assuming all along that innd should not be getting
that big.

Thanks for any help.


Frank Durda IV <uhclem@nemesis.lonestar.org>|"The Knights who say "LETNi"
or uhclem%nemesis@rwsystr.nkn.net           | demand...  A SEGMENT REGISTER!!!"
                                            |"A what?"
or ...letni!rwsys!nemesis!uhclem            |"LETNi! LETNi! LETNi!"  - 1983

Technical Details
Message-ID: <3252969E.41C67EA6@nemesis.lonestar.org>
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: <3252969E.41C67EA6@nemesis.lonestar.org>
Subject: INND dies after growing 5-8Meg/hour even with innd malloc
Date: Wed, 02 Oct 1996 00:00:00 +0000
From: Frank Durda IV <uhclem@nemesis.lonestar.org>
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: 186709562
Content-type: text/plain; charset=us-ascii
Organization: The Big Blue Box B
Mime-version: 1.0
Newsgroups: news.software.nntp
X-mailer: Mozilla 3.0Gold (X11; I; FreeBSD 2.1.5-RELEASE i386)