Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id DF9E12E2D6E for ; Thu, 15 Nov 2007 04:52:09 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 40881-09 for ; Thu, 15 Nov 2007 04:51:59 -0400 (AST) Received: from fischerappelt.de (mail.fischerappelt.de [217.110.127.211]) by postgresql.org (Postfix) with ESMTP id 430382E2B56 for ; Thu, 15 Nov 2007 04:51:58 -0400 (AST) Received: from [217.110.127.209] (account mty HELO [192.168.111.194]) by fischerappelt.de (CommuniGate Pro SMTP 5.1.7) with ESMTPA id 5619159; Thu, 15 Nov 2007 09:51:54 +0100 User-Agent: Microsoft-Entourage/11.3.6.070618 Date: Thu, 15 Nov 2007 09:51:53 +0100 Subject: Re: insufficient file descriptors on Mac OS X From: Maximilian Tyrtania To: CC: Tom Lane Message-ID: Thread-Topic: [ADMIN] insufficient file descriptors on Mac OS X Thread-Index: AcgnZMStA4QIN5NYEdyvXgAX8gNwZg== In-Reply-To: <11673.1194627344@sss.pgh.pa.us> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.178 tagged_above=0 required=5 tests=AWL=0.363, BAYES_40=-0.185 X-Spam-Level: X-Archive-Number: 200711/134 X-Sequence-Number: 27377 Hi, > Maximilian Tyrtania writes: >> <%2007-11-09 14:46:42 CETFATAL: 53000: insufficient file descriptors >> available to start server process > > This is not a shared-memory problem. > > On my Mac, ulimit -n seems to be 256 by default, and you've got > max_connections = 240 so nearly all of those will be eaten by > semaphores. > > You could change the ulimit setting, back off max_connections, > or apply this patch: > http://archives.postgresql.org/pgsql-committers/2007-09/msg00399.php Ah, okay. I think I'd like to change the ulimit -n setting (basically because i am new to PG and feel uneasy about applying patches yet), but I guess that would have to be done at boot time, right? Or at least before the server starts (which is at boot time in my case). > BTW, if you're really hoping to have 240 connections, you're > gonna need to do something about ulimit -u too. > max user processes (-u) 100 Okay, I managed to change that via sysctl.conf which now looks like this: kern.sysv.shmmax=134217728 kern.sysv.shmmin=1 kern.sysv.shmmni=1024 kern.sysv.shmseg=32 kern.sysv.shmall=65536 kern.maxproc=512 kern.macprocperuid=512 Btw, the machine (Mac OS 10.4.10) accepts those settings now, i didn't need to change /etc/rc. Now ulimit -a is Sputnik-Server:/ administrator$ ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) 6144 file size (blocks, -f) unlimited max locked memory (kbytes, -l) unlimited max memory size (kbytes, -m) unlimited open files (-n) 256 pipe size (512 bytes, -p) 1 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 266 virtual memory (kbytes, -v) unlimited So basically I managed to deal with the ulimit -u problem, but not yet with the ulimit -n one. For the time being I lowered the max_connections to 200, which allows me to start the server. I wonder if there is a way to set the number of allowed open files via sysctl.conf or if there is some other way to set that value at boot time already. Thanks a lot, Maximilian Tyrtania