Обсуждение: More on Too Many Open Files... NetBSD

Поиск
Список
Период
Сортировка

More on Too Many Open Files... NetBSD

От
"Ian Harding"
Дата:
Having no idea what i am looking for, I find...

bash-2.05$ ulimit -a
core file size (blocks)     unlimited
data seg size (kbytes)      131072
file size (blocks)          unlimited
max locked memory (kbytes)  168714
max memory size (kbytes)    506144
open files                  64
pipe size (512 bytes)       1
stack size (kbytes)         2048
cpu time (seconds)          unlimited
max user processes          80
virtual memory (kbytes)     133120
bash-2.05$ sysctl kern.maxfiles
kern.maxfiles = 1772

This looks like all is well?  Anyway, I still get

ERROR:  pltcl: couldn't create pipe: too many open files

Thanks, I hope this is the right place to post, I figure I am looking for someone who knows what PG needs and what
NetBSDis offering it... 

Ian A. Harding
Programmer/Analyst II
Tacoma-Pierce County Health Department
(253) 798-3549
mailto: iharding@tpchd.org


Re: More on Too Many Open Files... NetBSD

От
Bruce Momjian
Дата:
> This looks like all is well?  Anyway, I still get
>
> ERROR:  pltcl: couldn't create pipe: too many open files
>
> Thanks, I hope this is the right place to post, I figure I am
> looking for someone who knows what PG needs and what NetBSD is
> offering it...

Ulimit controls the maximum number of open files per process while
sysctl controls the maximum number of open files system-wide.  I would
look at sysctl.  However, if the number of system open files is low, I
would think you would see problems in more places.  Is it possible your
command-line is trying to open an infinite number of files?  Can you
send us your command line?

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Re: More on Too Many Open Files... NetBSD

От
"Ian Harding"
Дата:
The command from inside the pltcl function?  It is wrapped in a loop that should run about 200 times and is

        exec echo $msg | mail -s "New Timecard System" -c "ianh@tpchd.org" $U(username)@tpchd.org

where msg is a little message.

I start postgresql with default values.

Ian A. Harding
Programmer/Analyst II
Tacoma-Pierce County Health Department
(253) 798-3549
mailto: iharding@tpchd.org

>>> Bruce Momjian <pgman@candle.pha.pa.us> 12/18/01 02:30PM >>>
> This looks like all is well?  Anyway, I still get
>
> ERROR:  pltcl: couldn't create pipe: too many open files
>
> Thanks, I hope this is the right place to post, I figure I am
> looking for someone who knows what PG needs and what NetBSD is
> offering it...

Ulimit controls the maximum number of open files per process while
sysctl controls the maximum number of open files system-wide.  I would
look at sysctl.  However, if the number of system open files is low, I
would think you would see problems in more places.  Is it possible your
command-line is trying to open an infinite number of files?  Can you
send us your command line?

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026


Re: More on Too Many Open Files... NetBSD

От
Doug McNaught
Дата:
"Ian Harding" <ianh@tpchd.org> writes:

> Having no idea what i am looking for, I find...
>
> bash-2.05$ ulimit -a
[...]
> open files                  64

This is pretty low.  Each PG backend can open a lot of files with a
large database.  I'd try cranking it up in the script that starts PG.

> bash-2.05$ sysctl kern.maxfiles
> kern.maxfiles = 1772

If this is the systemwide limit it also might be a bit low.  It's more
likely to be the ulimit that's biting you though.

-Doug
--
Let us cross over the river, and rest under the shade of the trees.
   --T. J. Jackson, 1863

Re: More on Too Many Open Files... NetBSD

От
Matt Sauve-Frankel
Дата:
Hi,

I think you should read login.conf(5) on that netbsd box of yours.
http://www.tac.eu.org/cgi-bin/man-cgi?login.conf+5+NetBSD-1.5.1

It looks like you file limit is about right for a default login class
look at /etc/login.conf if it exists on your system..

--
Matt Sauve-Frankel        Philosophie Bleue | http://philosophiebleue.com
Network Administrator                  | http://pblue.com
--  An idea is not responsible for the people who believe in it

Re: More on Too Many Open Files... NetBSD

От
Matt Sauve-Frankel
Дата:
Hi,

from /usr/local/share/doc/postgresql/README.OpenBSD
on my OpenBSD 2.9 box

-snip
The ulimit settings can also be a problem.  The following can be
added for the postgresql user in the /etc/login.conf file:

        postgresql:\
                :maxproc-max=256:\
                :maxproc-cur=256:\
                :openfiles-cur=768:\
                :datasize-max=256M:\
                :datasize-cur=64M:\
                :stacksize-cur=4M:

For more than about 250 connections, these numbers should be
increased. Please report any changes and experiences to the package
maintainers so that we can update this file for future versions.
-/snip

you can assign a user to a login class by entering into the 5th field of your
passwd file. (edit it with vipw) check passwd(5) to be sure

postgresql:*:1013:1013:postgresql:0:0:PostgreSQL:/var/postgresql:/sbin/nologin

--
Matt Sauve-Frankel        Philosophie Bleue | http://philosophiebleue.com
Network Administrator                  | http://pblue.com
--  An idea is not responsible for the people who believe in it