X-Original-To: pgsql-admin@postgresql.org Received: from perrin.int.nxad.com (unknown [69.1.70.251]) by postgresql.org (Postfix) with ESMTP id D5794475461 for ; Mon, 17 Mar 2003 18:26:38 -0500 (EST) Received: by perrin.int.nxad.com (Postfix, from userid 1001) id 6026B20F01; Mon, 17 Mar 2003 15:26:40 -0800 (PST) Date: Mon, 17 Mar 2003 15:26:40 -0800 From: Sean Chittenden To: =?unknown-8bit?Q?Sime=F3?= Reig Cc: Babak Badaei , pgsql-admin@postgresql.org Subject: Re: max_connections limit Message-ID: <20030317232640.GV23355@perrin.int.nxad.com> References: <20030317214830.GN23355@perrin.int.nxad.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3Gf/FFewwPeBMqCJ" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-PGP-Key: finger seanc@FreeBSD.org X-PGP-Fingerprint: 3849 3760 1AFE 7B17 11A0 83A6 DD99 E31F BC84 B341 X-Web-Homepage: http://sean.chittenden.org/ X-Archive-Number: 200303/282 X-Sequence-Number: 7922 --3Gf/FFewwPeBMqCJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > > > 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=3D65536 options SEMMNI=3D40 options SEMMNS=3D240 options SEMUME=3D40 options SEMMNU=3D120 ### 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 --=20 Sean Chittenden --3Gf/FFewwPeBMqCJ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Comment: Sean Chittenden iD8DBQE+dlmv3ZnjH7yEs0ERAnJuAKC48Y3qyCm2b20TkDU7I5YTpNCq0wCgm0IU qjEGC5ZX/9/iP3TY7QRa6Pg= =5/CA -----END PGP SIGNATURE----- --3Gf/FFewwPeBMqCJ--