From owner-freebsd-hackers Sun Aug 27 16:33:20 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from thelab.hub.org (nat211.169.mpoweredpc.net [142.177.211.169]) by hub.freebsd.org (Postfix) with ESMTP id 93AC937B424 for ; Sun, 27 Aug 2000 16:33:17 -0700 (PDT) Received: from localhost (scrappy@localhost) by thelab.hub.org (8.9.3/8.9.3) with ESMTP id UAA05335; Sun, 27 Aug 2000 20:31:43 -0300 (ADT) (envelope-from scrappy@hub.org) X-Authentication-Warning: thelab.hub.org: scrappy owned process doing -bs Date: Sun, 27 Aug 2000 20:31:43 -0300 (ADT) From: The Hermit Hacker To: Tom Lane Cc: freebsd-hackers@freebsd.org, pgsql-hackers@postgreSQL.org Subject: Re: Too many open files (was Re: spinlock problems reported earlier) In-Reply-To: <25215.967405372@sss.pgh.pa.us> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 process 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; #else max_files_per_backend = sysconf(_SC_OPEN_MAX); #endif To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message