Article View: news.software.nntp
Article #10323Re: Probs with innfeed 0.8.5b on Solaris
From: Joe Greco
Date: Thu, 22 Aug 1996 00:00
Date: Thu, 22 Aug 1996 00:00
114 lines
5009 bytes
5009 bytes
In news.software.nntp article <4vi48m$flj@gw.home.vix.com>, brister@gw.home.vix.com (James Brister) wrote:
:Joe Greco (jgreco@brasil.moneng.mei.com) wrote:
:: In news.software.nntp article <4vhun0$90g@gw.home.vix.com>, brister@gw.home.vix.com (James Brister) wrote:
:: :As for mmap(). You need a open file descriptor for that, and file
:
:: Ummmm.. not to differ with you, but I do not agree with that: :-)
:
:: SunOS 4.1.3, man mmap(), page 1:
:
:Yeah, I see ... sort of counter-intuitive, but useful. Thanks. I'll start
:thinking about what needs to be done to use it.
As I just wrote you in private mail, I just caused a box to croak due to
excessive mmap'ing :-) however I think it was at around the 25K-50K files
mark.
Ooooooh it must have been a hard panic, there's no information about the
crash... no crash dump or anything. Neat.
Ahhhh coool... running it again...
We lost our mind at 42900 vnodes... :-)
# vmstat -m | grep vnodes
vnodes 42315 5288K 5288K 19661K 43480 0 0 16,128,256
vnodes 42319 5288K 5288K 19661K 43484 0 0 16,128,256
vnodes 42320 5288K 5288K 19661K 43485 0 0 16,128,256
vnodes 42324 5289K 5289K 19661K 43489 0 0 16,128,256
vnodes 42447 5304K 5304K 19661K 43612 0 0 16,128,256
vnodes 42504 5311K 5311K 19661K 43669 0 0 16,128,256
vnodes 42900 5361K 5361K 19661K 44065 0 0 16,128,256
Looks like FreeBSD has a bug. The program itself managed to map most of
those...:
[38400] .. [38912] .. [39424] .. [39936] .. [40448] .. [40960] .. [41472] .. [41984] .. [42496] ..
Time to talk to Mr. Dyson. ;-)
Well... Solaris tops out at about 14848, of course I hadn't tuned any
values on that box to be more permissive. But at least it stopped with
"mmap: Not enough space".
My test program is enclosed below.
:: I think it might be mildly hairy for innfeed, only because you would need
:: to do output processing of the article.. you need to look for any "\n."
:: sequences and add an additional '.'. I assume that you probably do that
:: while reading in an article right now.. hm.. yes, in nntpPrepareBuffer..
:
:Got to add the '\r' everywhere too... I originally had it doing no
S*** I forgot about that :-) Shows you how much NNTP/SMTP programming stuff
I've been doing these days.
:bit-fiddling at all, but using 2 iovec structs per line (one for body
:and one for '\r'), but backed out of that when I saw the really
:small value SVR4 machines have for the max you can pass into writev.
:Guess I'll look into going back to that.
That would probably be my preferred way to see it done, otherwise you are
probably dealing with shuffling in userland AND shuffling in kernelland (I
haven't looked to see how efficient writev is, however).
... JG
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <fcntl.h>
#define MAX 1048576
caddr_t array[MAX];
int main()
{
int i = 0;
int fd;
char filename[2048];
struct stat s;
caddr_t this;
while (i < MAX) {
gets(filename);
if ((fd = open(filename, O_RDONLY, 0)) < 0) {
perror(filename);
sleep(1);
} else {
if (fstat(fd, &s) < 0) {
perror("fstat");
sleep(1);
} else {
this = mmap((caddr_t) 0, s.st_size, PROT_READ,
MAP_PRIVATE, fd, (off_t) 0);
if ((int) this == -1) {
perror("mmap");
sleep(1);
} else {
array[i++] = this;
}
}
close(fd);
}
if (! (i % 512)) {
fprintf(stderr, "[%d] .. ", i);
}
}
}
Technical Details
Message-ID:
<4vid1q$oeb@brasil.moneng.mei.com>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-mailReferences:
<4vc7hk$sjj@news2.cais.com> <4vhun0$90g@gw.home.vix.com> <4vi124$o7u@brasil.moneng.mei.com> <4vi48m$flj@gw.home.vix.com>Show Full Headers
Complete Article Headers
Message-ID: <4vid1q$oeb@brasil.moneng.mei.com> Subject: Re: Probs with innfeed 0.8.5b on Solaris Date: Thu, 22 Aug 1996 00:00:00 +0000 From: jgreco@brasil.moneng.mei.com (Joe Greco) References: <4vc7hk$sjj@news2.cais.com> <4vhun0$90g@gw.home.vix.com> <4vi124$o7u@brasil.moneng.mei.com> <4vi48m$flj@gw.home.vix.com> 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: 175880217 Distribution: inet Organization: Marquette Electronics, Inc. - Milwaukee, WI. Newsgroups: news.software.nntp