Re: max_connections limit

From: Sean Chittenden <sean(at)chittenden(dot)org>
To: Sime Reig <simeo(at)incofisa(dot)com>
Cc: Babak Badaei <babak(at)hemaka(dot)com>, pgsql-admin(at)postgresql(dot)org
Subject: Re: max_connections limit
Date: 2003-03-17 23:26:40
Message-ID: 20030317232640.GV23355@perrin.int.nxad.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

> > > I have a server running FreeBSD 4.7 and postgres 7.2.4 and when I
> > > set "max_connections" to a value greater than 47, I am unable to
> > > connect to the database server. I need to be able to raise this
> > > number much higher because every site on this server runs postgres
> > > and at peak times this limit is reached and causes problems. The
> > > server has 2 gigs of memory. I would appreciate any suggestion.
> >
> > What's the output in /var/log/pgsql ? -sc
>
> I have a freeBSD with postgres too and I believe I had to tune the
> kernel for this question

That's what I was getting at actually. When you install PostgreSQL
via the ports, a file is both sent to the user for visual review, as
well being copied to a file:

/usr/local/pgsql/post-install-notes

Please review this and see if this doesn't solve your problem.
FreeBSDs SHM settings are low by default and need to be increased for
any kind of production use.

### Begin
To allow many simultaneous connections to your PostgreSQL server, you
should raise the SystemV shared memory limits in your kernel. Here are
example values for allowing up to 180 clients (tinkering in
postgresql.conf also needed, of course):
options SYSVSHM
options SYSVSEM
options SYSVMSG
options SHMMAXPGS=65536
options SEMMNI=40
options SEMMNS=240
options SEMUME=40
options SEMMNU=120
### End

Please let me know if anyone thinks these numbers should be revised or
could be broken down into a formula for calculation and I'll
incorporate them. -sc

--
Sean Chittenden

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Sime Reig 2003-03-17 23:29:54 Re: max_connections limit
Previous Message Tom Lane 2003-03-17 21:50:24 Re: Problem with view upgrading from 7.2 to 7.3