Re: insufficient file descriptors on Mac OS X

From: Maximilian Tyrtania <mty(at)fischerappelt(dot)de>
To: <pgsql-admin(at)postgresql(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: insufficient file descriptors on Mac OS X
Date: 2007-11-15 08:51:53
Message-ID: C361C739.2C054%mty@fischerappelt.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi,

> Maximilian Tyrtania <mty(at)fischerappelt(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message jm 2007-11-15 09:07:44 Re: help to Brazil
Previous Message Tom Lane 2007-11-15 05:37:27 Re: Error: duplicate key violates unique constraint - "pg_toast_3270368541_index