🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
11 messages
11 total messages Started by Jens Vieler Mon, 04 Oct 1999 00:00
INN2.2: Too many open files
#40479
Author: Jens Vieler
Date: Mon, 04 Oct 1999 00:00
20 lines
1275 bytes
good morning,

my INN2.2 on solaris2.6 shows a strange behavior: last weekend it
stops receiving articles from incomming readers without informing the clients.
articles went to nirvana.
server-connections could be informed, because after booting the system
they send the whole weekend-traffic - so they spooled the articles.

looking into news.err shows:
    innd: SERVER cant accept RCreader Too many open files

because i am no sun-system-expert i'll ask you: what should be done?
is it a temporary system-problem? any INN-problem? the INNFAQ can't
answer this.

regards
     jens

Re: INN2.2: Too many open files
#40421
Author: jan
Date: Mon, 04 Oct 1999 00:00
19 lines
1026 bytes
Russ Allbery wrote:

>      .......
>  set rlim_fd_cur = 1024
>  in /etc/system and rebooting.

> --
> Russ Allbery (rra@stanford.edu)         <URL:http://www.eyrie.org/~eagle/>

extra information on all kinda "solaris tunig"can be found at:

http://www.rvs.uni-hannover.de/people/voeckler/tune/EN/tune.html


-Jan



Re: INN2.2: Too many open files
#40427
Author: Russ Allbery
Date: Mon, 04 Oct 1999 00:00
45 lines
2768 bytes
Jens Vieler <jens.vieler@fernuni-hagen.de> writes:

> my INN2.2 on solaris2.6 shows a strange behavior: last weekend it stops
> receiving articles from incomming readers without informing the clients.
> articles went to nirvana.

File Descriptor Limits

    INN likes to use a lot of file descriptors, particularly if you have a
    lot of peers.  Depending on what your system defaults are, you may need
    to make sure the default limit is increased for INN (particularly innd
    and innfeed).  This is vital on Solaris, which defaults (at least as of
    2.6) to an absurdly low limit of 64 file descriptors per process.

    One way to increase the number of file descriptors is to set
    rlimitnofile in inn.conf to a higher value.  This will cause
    startinnfeed and inndstart, the setuid root wrapper scripts that start
    innfeed and innd respectively, to increase the file descriptor limits
    before they run the regular INN programs.  Note, however, that you won't
    be able to increase the limits above the hard limits set by your
    operating system; on some systems, that hard limit is 256 file
    descriptors (Linux, for example).  On others, like Solaris, it's 1024. 
    Increasing the limit beyond that value may require serious system
    configuration work (on Linux, patching and recompiling the kernel; on
    Solaris 2.6 or earlier, the limit cannot be increased beyond 1024
    without breaking select() and thereby breaking all of INN).

    256 file descriptors will probably be enough for all but the largest
    site.  There is no harm in setting the limits higher than you actually
    need (provided they're set to something lower than or equal to your
    system hard limit).  256 is therefore a reasonable value to try.

    If you're installing INN on a Solaris system, particularly if you're
    installing it on a dedicated news server machine, it may be easier to
    just increase the default file descriptor limit across the board for all
    processes.  You can do that by putting the line:

        set rlim_fd_cur = 1024

    in /etc/system and rebooting.

-- 
Russ Allbery (rra@stanford.edu)         <URL:http://www.eyrie.org/~eagle/>

Re: INN2.2: Too many open files
#40446
Author: Russ Allbery
Date: Mon, 04 Oct 1999 00:00
44 lines
2636 bytes
(Copied to the maintainer of the page mentioned below.)

jan <jan@online.be> writes:

> extra information on all kinda "solaris tunig"can be found at:

> http://www.rvs.uni-hannover.de/people/voeckler/tune/EN/tune.html

This page has one of the common old recommendations about soft file
descriptor limits:

| With respect to the standard IO library, you should not raise the soft
| limit above 256. Stdio can only use <= 256 FDs.

While the second statement is true, at lesat with Solaris 2.6 (Solaris 7
changed a bunch of this stuff), the first statement isn't necessarily.
This will only be a problem if your stdio-using program opens more than
256 files or if you're using fdopen() to turn file descriptors over 256
into stdio FILEs.

My experience is that most applications that use lots of open files either
use strictly raw file descriptors or strictly stdio and that the mixing
doesn't end up being much of a problem.  Furthermore, note that if you've
got a file descriptor valued over 256, under normal circumstances (ie, in
the absence of intentionally relocating file descriptors, which is
something INN does a bit of) your program would have failed *anyway* with
a limit of 256.  Failing by hitting a file descriptor limit may fail more
cleanly than failing by hitting stdio errors, but I don't think that's
enough to warrant the recommendation against doing this.

For dedicated INN server systems, I still recommend increasing the soft
limit to 1024 and then forgetting about it.  INN uses stdio as little as
possible, and basically not at all in the processes that have to open lots
of files.

This page also recommends increasing the hard limit over 1024, which is
something that you absolutely do not want to do for INN as it may break
select().  (The text does point out the problems with this.)  The text
there seems mostly aimed at tuning Squid systems.

-- 
Russ Allbery (rra@stanford.edu)         <URL:http://www.eyrie.org/~eagle/>

Re: INN2.2: Too many open files
#40451
Author: Russ Allbery
Date: Mon, 04 Oct 1999 00:00
18 lines
1318 bytes
Paul Tomblin <ptomblin@piper.xcski.com> writes:
> In a previous article, Russ Allbery <rra@stanford.edu> said:

>>    One way to increase the number of file descriptors is to set
>>    rlimitnofile in inn.conf to a higher value.  This will cause

> Is this parameter in 2.2?  I did a grep through the source code for
> 2.2.1, and the only mention I can find of setrlimit(NO_FILE... is
> controlled by a "#ifdef" and a variable I can't figure out how to set to
> anything other than the default -1.

Thought it was, but looks like it's not.  :/  Edit config/config.data and
change NOFILE_LIMIT to whatever you want.

-- 
Russ Allbery (rra@stanford.edu)         <URL:http://www.eyrie.org/~eagle/>

Re: INN2.2: Too many open files
#40459
Author: Paul Tomblin
Date: Mon, 04 Oct 1999 00:00
16 lines
1504 bytes
In a previous article, Russ Allbery <rra@stanford.edu> said:
>    One way to increase the number of file descriptors is to set
>    rlimitnofile in inn.conf to a higher value.  This will cause

Is this parameter in 2.2?  I did a grep through the source code for 2.2.1, and
the only mention I can find of setrlimit(NO_FILE... is controlled by a
"#ifdef" and a variable I can't figure out how to set to anything other than
the default -1.


-- 
Paul Tomblin, not speaking for anybody.
SETI@Home:  Finally a *good* way to impress Jodie Foster
http://www.setiathome.ssl.berkeley.edu/

Re: INN2.2: Too many open files
#40495
Author: Katsuhiro Kondou
Date: Tue, 05 Oct 1999 00:00
16 lines
1531 bytes
In article <7tagca$5o8$1@piper.xcski.com>,
	ptomblin@piper.xcski.com (Paul Tomblin) wrote;

} Is this parameter in 2.2?  I did a grep through the source code for 2.2.1, and

That's in 2.3.

} the only mention I can find of setrlimit(NO_FILE... is controlled by a
} "#ifdef" and a variable I can't figure out how to set to anything other than
} the default -1.

Yes.  For 2.2*, you tend to recompile if you'll change.
-- 
Katsuhiro Kondou

Re: INN2.2: Too many open files
#40567
Author: Jens Vieler
Date: Wed, 06 Oct 1999 00:00
13 lines
1231 bytes
thank you all,
IMHO increasing the standard system-limits could be dangerous, because INN2.2
isn't the only service on this maschine, and i don't know anything about
the "resource-hunger" of other software in this case.

i found the "ulimit -n 256" before rc.news start's - seems to work well
and is used by some other INN-admins. what do you think abaout it?

regards 
        jens

Re: INN2.2: Too many open files
#40584
Author: Russ Allbery
Date: Wed, 06 Oct 1999 00:00
13 lines
1153 bytes
Jens Vieler <jens.vieler@fernuni-hagen.de> writes:

> i found the "ulimit -n 256" before rc.news start's - seems to work well
> and is used by some other INN-admins. what do you think abaout it?

Should work.  Probably mostly redundant with inndstart and startinnfeed,
which can also increase the limits if you configure them to do so (this is
easier to do in 2.3 than in 2.2.1).

-- 
Russ Allbery (rra@stanford.edu)         <URL:http://www.eyrie.org/~eagle/>

Re: INN2.2: Too many open files
#40661
Author: Jens-S. Voeckler
Date: Thu, 07 Oct 1999 00:00
112 lines
6468 bytes
On 4 Oct 1999, Russ Allbery wrote:

]jan <jan@online.be> writes:
]
]> extra information on all kinda "solaris tunig"can be found at:
]> http://www.rvs.uni-hannover.de/people/voeckler/tune/EN/tune.html
]
]This page has one of the common old recommendations about soft file
]descriptor limits:
]
]| With respect to the standard IO library, you should not raise the soft
]| limit above 256. Stdio can only use <= 256 FDs.
]
]While the second statement is true, at lesat with Solaris 2.6 (Solaris 7
]changed a bunch of this stuff), the first statement isn't necessarily.

The quote should continue with the complete paragraph:

]| You can either use AT&T's sfio library, or wait for Solaris 7
]| which is said to have fixed this weakness. RPC prior to 2.6 may
]| break, if more than 1024 FDs are available to it.

RPC might even break, if there are more than 256 FDs available to it... 

As to Solaris 7, if you do nothing about your code, even in 64 bit mode
the limit on stdio is still 256. You need to use the "-xarch=v9" option in
order to compile for 64 bit mode, and thus for more than 256 stdio FDs.
SUN says in its answer books on 64 bit environments:

)In the 64-bit environment, the stdio facility has been extended to allow
)more than 256 streams to be open simultaneously. The 32-bit stdio
)facility continues to have a 256 streams limit.

But we were talking about the soft limit. Any software needing more can
use the [gs]etrlimit calls to increase their soft limit, or log an error,
if the hard limit was set too low.

Historically, I recommeded more than 256 FDs as soft limit. You would not
believe, how many people (me included) just scan the tuning tips and use
the suggested values without bothering to think about what they are doing.
And if you raised your FD soft limit above 256 (up to and including S2.6),
and you use the SUN workshop compilers, do not complain to me (or SUN)
that the license manager fails to connect via RPC, thus you license is
not found and thus your compiler does not work... That is basically the
major reason for suggesting 256 as system wide default soft limit (not
hard limit, mind you). As server software runs with a different user id,
one can always set a different limit there on a per user basis.

]This will only be a problem if your stdio-using program opens more than
]256 files or if you're using fdopen() to turn file descriptors over 256
]into stdio FILEs.

That is correct.

]My experience is that most applications that use lots of open files either
]use strictly raw file descriptors or strictly stdio and that the mixing
]doesn't end up being much of a problem.  

All three are correct.

]Furthermore, note that if you've got a file descriptor valued over 256,
]under normal circumstances (ie, in the absence of intentionally
]relocating file descriptors, which is something INN does a bit of) your
]program would have failed *anyway* with a limit of 256.  Failing by
]hitting a file descriptor limit may fail more cleanly than failing by
]hitting stdio errors, but I don't think that's enough to warrant the
]recommendation against doing this.
]
]For dedicated INN server systems, I still recommend increasing the soft
]limit to 1024 and then forgetting about it.  INN uses stdio as little as
]possible, and basically not at all in the processes that have to open lots
]of files.

I would recommed to include code into INN that does FD checks like squid
during start-up, e.g. have a look about the amount of FDs available (hard
limit), and increase the soft limit as necessary, or complain, if the hard
limit is too low. After all, soft limits are *meant* to be changed, if too
low. It is about a screen page of code, and gives many users much less
trouble than providing for them a HOWTO fix the limits for a variety of
systems and releases.

Though getrlimit() and setrlimit() are not part of POSIX (according to
Stevens APUE), both SVR4 and 4.3+BSD provide them. The only catch is to
look out for RLIMIT_NOFILE (SVR4) versus RLIMIT_OFILE (BSD) - nothing a
small #if #define #endif couldn't catch... But then, if it is not strictly
POSIX, it might not run on NT ;-) But then, the sysinfo(_SC_OPEN_MAX) will
return the soft limit, and it is POSIX conformant.

]This page also recommends increasing the hard limit over 1024, which is
]something that you absolutely do not want to do for INN as it may break
]select().  (The text does point out the problems with this.)  The text
]there seems mostly aimed at tuning Squid systems.

Squid is what my experiences are best with, but the tuning tips are
provided having dedicated servers in mind, (almost) regardless of the type
of service provided, though, yes, the bias is on web services and
especially on WAN connections. Admittedly, there is no magic silver bullet
for all servers and services, e.g. I got a whole set of different tunings
for lab equipment and heavy service benchmarking.

BTW, recoding from select() to poll() is not very difficult, and it is
said to be even a bit faster on Solaris systems as added sugar besides
having more than 1024 FDs available.

Le deagh dhùrachd,
Dipl.-Ing. Jens-S. Vöckler (voeckler@rvs.uni-hannover.de)
Institute for Computer Networks and Distributed Systems
University of Hanover, Germany; +49 511 762 4726


Re: INN2.2: Too many open files
#40671
Author: Russ Allbery
Date: Fri, 08 Oct 1999 00:00
70 lines
3919 bytes
[ Posted and mailed, in case you don't read this newsgroup. ]

Jens-S Voeckler <voeckler@rvs.uni-hannover.de> writes:

> The quote should continue with the complete paragraph:

> ]| You can either use AT&T's sfio library, or wait for Solaris 7
> ]| which is said to have fixed this weakness. RPC prior to 2.6 may
> ]| break, if more than 1024 FDs are available to it.

> RPC might even break, if there are more than 256 FDs available to it... 

Sorry, I was quoting only the portions relevant to INN (which doesn't use
RPC).  I'm not disagreeing with your conclusions within a context broader
than just INN servers.  I should have made that more clear.

> But we were talking about the soft limit. Any software needing more can
> use the [gs]etrlimit calls to increase their soft limit, or log an
> error, if the hard limit was set too low.

And INN does do this already in some places, but people keep getting bit
by other places that end up needing it when they hadn't in the past.  It's
arguably a bug in INN that all of the separate programs don't try to
increase their file descriptor limits when they need to, but for a very
long time on a dedicated news server box it's been a better idea to just
globally increase the limits.

> Historically, I recommeded more than 256 FDs as soft limit. You would
> not believe, how many people (me included) just scan the tuning tips and
> use the suggested values without bothering to think about what they are
> doing.  And if you raised your FD soft limit above 256 (up to and
> including S2.6), and you use the SUN workshop compilers, do not complain
> to me (or SUN) that the license manager fails to connect via RPC, thus
> you license is not found and thus your compiler does not work...

Hm.  Yes, that's a good point.  Thanks.

> I would recommed to include code into INN that does FD checks like squid
> during start-up, e.g. have a look about the amount of FDs available
> (hard limit), and increase the soft limit as necessary, or complain, if
> the hard limit is too low.

innd and innfeed do do this (via a setuid program, in fact, so they'll
even raise hard limits if necessary).  The problem with INN that's
different than Squid is that INN is a large collection of separate
programs rather than one daemon.

> Though getrlimit() and setrlimit() are not part of POSIX (according to
> Stevens APUE), both SVR4 and 4.3+BSD provide them. The only catch is to
> look out for RLIMIT_NOFILE (SVR4) versus RLIMIT_OFILE (BSD) - nothing a
> small #if #define #endif couldn't catch...

Hm.  Not sure if we're accounting for that currently; I should go check.
Thanks.

> But then, if it is not strictly POSIX, it might not run on NT ;-)

For INN, I really don't care.  :)

> BTW, recoding from select() to poll() is not very difficult, and it is
> said to be even a bit faster on Solaris systems as added sugar besides
> having more than 1024 FDs available.

Probably worth making a poll() implementation available, but poll() isn't
(yet) as portable as select().

-- 
Russ Allbery (rra@stanford.edu)         <URL:http://www.eyrie.org/~eagle/>

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