Обсуждение: freebsd & postgresql 7.1.3

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

freebsd & postgresql 7.1.3

От
"Yuri A. Kabaenkov"
Дата:
Hello,

      Please can anyone tell me with what options must i start
      postmaster to handle many connections on subj.

      May be i need to recompile my kernel, if yes what options should
      i add?

      And how my RAM depends on this values ?


      I develop software on mod_perl,pgsql,Apache::DBI
      and Apache::DBI opens new connection per any apache child.

      and in my error log these errors:

NOTICE:  Message from PostgreSQL backend:
        The Postmaster has informed me that some other backend  died abnormally and possibly corrupted shared memory.
        I have rolled back the current transaction and am       going to terminate your database system connection and
exit.
        Please reconnect to the database system and repeat your query.

è

DBI->connect(dbname=hell;port=5432;host=localhost) failed: Sorry, too many clients already at helltoplib.pm line 41
[Sat Nov 24 14:03:19 2001] [error] Sorry, too many clients already at helltoplib.pm line 41.

How can if fix it ?




------------
With respect,
Yuri A. Kabaenkov
hellman@artofit.com




Re: freebsd & postgresql 7.1.3

От
Brent Verner
Дата:
On 25 Nov 2001 at 07:24 (+0300), Yuri A. Kabaenkov wrote:
| Hello,
|
|       Please can anyone tell me with what options must i start
|       postmaster to handle many connections on subj.

in your postgresql.conf, set:

max_connections = NN

|       May be i need to recompile my kernel, if yes what options should
|       i add?

most likely.  The kernel parameters you are interested in are:

options SEMMNI=AA
options SEMMNS=BB

...now, the values for SEMMNI and SEMMNS to support NN connections,
I'm not /sure/ of, but for NN==64 I set the following in my kernel

options SEMMNI=32
options SEMMNS=128

There may be other kernel parameters to help you get better performance,
so you might want to dig around the freebsd handbook a bit ;-)

hth.
  brent

--
"Develop your talent, man, and leave the world something. Records are
really gifts from people. To think that an artist would love you enough
to share his music with anyone is a beautiful thing."  -- Duane Allman

Re: freebsd & postgresql 7.1.3

От
Vivek Khera
Дата:
>>>>> "YAK" == Yuri A Kabaenkov <sec@artofit.com> writes:

YAK>       May be i need to recompile my kernel, if yes what options should
YAK>       i add?

YAK>       And how my RAM depends on this values ?

Postgres tuning is basically all about shared memory segments.  In
FreeBSD, you don't need to recompile your kernel.  Just set the
appropriate sysctl variables.  I do this in my /etc/sysctl.conf file:

# tuning for PostgreSQL
kern.ipc.shmall=65535
kern.ipc.shmmax=268435456
kern.ipc.shm_use_phys=1

on a machine with 512MB RAM doing nothing but PostgreSQL serving.
Adjust the numbers as you see fit, and as described in the tuning
sections of the documentation.  The SEM values seem to be ok with
their defaults in the FreeBSD kernel.

Once you tune the kernel, then you need to tune Postgres to use the
added capacity.

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.                Khera Communications, Inc.
Internet: khera@kciLink.com       Rockville, MD       +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera   http://www.khera.org/~vivek/