Re: Re: Too many open files (was Re: spinlock problems reported earlier)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: The Hermit Hacker <scrappy(at)hub(dot)org>
Cc: Brook Milligan <brook(at)biology(dot)nmsu(dot)edu>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Re: Too many open files (was Re: spinlock problems reported earlier)
Date: 2000-08-28 18:30:05
Message-ID: 16725.967487405@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The Hermit Hacker <scrappy(at)hub(dot)org> writes:
>> cat t.c
> #include <stdio.h>
> #include <unistd.h>

> main()
> {
> printf("%ld\n", sysconf(_SC_OPEN_MAX));
> }

>> ./t
> 4136

Yup, there's our problem. Each backend will feel entitled to open up to
about 4100 files, assuming it manages to hit that many distinct tables/
indexes during its run. You probably haven't got that many, but even
several hundred files times a couple dozen backends would start pushing
your (previous) kernel FD limit.

So, at least on FreeBSD, we can't trust sysconf(_SC_OPEN_MAX) to tell us
the number we need.

An explicit parameter to the postmaster, setting the installation-wide
open file count (with default maybe about 50 * MaxBackends) is starting
to look like a good answer to me. Comments?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message The Hermit Hacker 2000-08-28 18:48:51 Re: Re: Too many open files (was Re: spinlock problems reported earlier)
Previous Message Hannu Krosing 2000-08-28 18:29:17 Re: SQL COPY syntax extension (was: Performance on inserts)