Re: Too Many Open Files... NetBSD

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Ian Harding" <ianh(at)tpchd(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Too Many Open Files... NetBSD
Date: 2001-12-18 23:53:51
Message-ID: 19477.1008719631@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Ian Harding" <ianh(at)tpchd(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2001-12-18 23:55:12 Re: another foreign key question
Previous Message Doug McNaught 2001-12-18 23:49:13 Re: Way to use count() and LIMIT?