pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Maximilian Tyrtania <mty@fischerappelt.de>
To: pgsql-admin@postgresql.org
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Subject: Re: insufficient file descriptors on Mac OS X
Date: Thu, 15 Nov 2007 09:51:53 +0100
Message-ID: <C361C739.2C054%mty@fischerappelt.de> (raw)
In-Reply-To: <11673.1194627344@sss.pgh.pa.us>

Hi,
 
> Maximilian Tyrtania <mty@fischerappelt.de> 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






view thread (3+ messages)

Message-ID: <C361C739.2C054%mty@fischerappelt.de>
Permalink:  ../C361C739.2C054%25mty@fischerappelt.de/
Also on:    postgresql.org/message-id/C361C739.2C054%mty@fischerappelt.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: mty@fischerappelt.de, tgl@sss.pgh.pa.us
  Subject: Re: insufficient file descriptors on Mac OS X
  In-Reply-To: <C361C739.2C054%mty@fischerappelt.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox