Skip site navigation (1) Skip section navigation (2)

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

From: The Hermit Hacker <scrappy(at)hub(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: freebsd-hackers(at)freebsd(dot)org, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Too many open files (was Re: spinlock problems reported earlier)
Date: 2000-08-27 23:31:43
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On Sun, 27 Aug 2000, Tom Lane wrote:

> Hmm, this is interesting: on HPUX, man sysconf(2) says that
> sysconf(_SC_OPEN_MAX) returns the max number of open files per process
> --- which is what fd.c assumes it means.  But I see that on your FreeBSD
> box, the sysconf man page defines it as
>      _SC_OPEN_MAX
>              The maximum number of open files per user id.
> which suggests that *on that platform* we need to divide by MAXBACKENDS.
> Does anyone know of a more portable way to determine the appropriate
> number of open files per backend?

Okay, I just checked out Solaris 8/x86, and it confirms what HP/ux thinks:

     _SC_OPEN_MAX            OPEN_MAX                   Max open files per

I'm curious as to whether FreeBSD is the only one that doesn't follow this
"convention"?   I'm CCng in the FreeBSD Hackers mailing list to see if
someone there might be able to shed some light on this ... my first
thought, personally, would be to throw in some sort of:

#ifdef __FreeBSD__
  max_files_per_backend = sysconf(_SC_OPEN_MAX) / num_of_backends;
  max_files_per_backend = sysconf(_SC_OPEN_MAX);

In response to


pgsql-hackers by date

Next:From: Tom LaneDate: 2000-08-28 00:05:29
Subject: Possible performance improvement: buffer replacement policy
Previous:From: ChrisDate: 2000-08-27 23:11:49
Subject: Re: Performance on inserts

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group