Re: Too Many Open Files... NetBSD - Mailing list pgsql-general

From Tom Lane
Subject Re: Too Many Open Files... NetBSD
Date
Msg-id 19477.1008719631@sss.pgh.pa.us
Whole thread Raw
In response to Too Many Open Files... NetBSD  ("Ian Harding" <ianh@tpchd.org>)
List pgsql-general
"Ian Harding" <ianh@tpchd.org> writes:
> Argh.  I have finally come to the point where i have to pay attention to this nuts and bolts stuff.
> I get:  ERROR:  pltcl: couldn't create pipe: too many open files

My guess is that you are running into the fact that Postgres doesn't
allow a lot of headroom between the system's open-files-per-process
ulimit and the number of files it will open on its own account.  It
looks like the headroom is only 10 by default (see fd.c); and I think
stdin/stdout/stderr/client-socket etc are part of the 10.  So if you are
trying to execute something like system() that might open several more
files, you could easily hit the ulimit.

You will certainly want to increase the ulimit, but the trick remains
to keep Postgres from slurping it all for itself.  In 7.1 I think the
only way is to recompile with a larger RESERVE_FOR_LD value in fd.c.
In 7.2 there is a config variable that can be set to limit Postgres'
usage of file descriptors to something less than your ulimit value.

            regards, tom lane

pgsql-general by date:

Previous
From: Doug McNaught
Date:
Subject: Re: Way to use count() and LIMIT?
Next
From: "Mitch Vincent"
Date:
Subject: Re: Way to use count() and LIMIT?