From owner-freebsd-performance@FreeBSD.ORG Thu Aug 4 17:01:31 2005 Return-Path: X-Original-To: freebsd-performance@freebsd.org Delivered-To: freebsd-performance@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8191416A420 for ; Thu, 4 Aug 2005 17:01:31 +0000 (GMT) (envelope-from kometen@gmail.com) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.197]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0625743D49 for ; Thu, 4 Aug 2005 17:01:30 +0000 (GMT) (envelope-from kometen@gmail.com) Received: by wproxy.gmail.com with SMTP id i22so434694wra for ; Thu, 04 Aug 2005 10:01:30 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=tE4QlIbhq3ijw5iUdMyUcA9FA7FCZ36PzSDyX0TimodfVi7jaxxKAnP0ecG8sl5IcbiGsULUN30EJo9EywkdmOGtfPQn8AQaHp08mbz6zrhEPEyapsNN5LTHx0YSiOPq0VJqrATYKt7/Cpphl+s8GF2GnxUQa00m40PposrXjLU= Received: by 10.54.13.77 with SMTP id 77mr1700517wrm; Thu, 04 Aug 2005 10:01:29 -0700 (PDT) Received: by 10.54.144.11 with HTTP; Thu, 4 Aug 2005 10:01:29 -0700 (PDT) Message-ID: Date: Thu, 4 Aug 2005 19:01:29 +0200 From: Claus Guttesen To: freebsd-performance@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: changing max_connections in postgresql on FreeBSD 5.4 X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Claus Guttesen List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Aug 2005 17:01:31 -0000 Hi. I recently lowered max_connections from 1024 to 384 in /usr/local/pgsql/data/postgresql.conf. The server is a quad opteron @ 2 GHz and 4 GB of RAM. This decreased the SIZE and RES values in top and it seems that the current max_connections is more than adequate. To see how many concurrent connections the db-server had I did a 'netstat -na|grep -i establi|wc -l' which showed some 230 established connections during peak. In order to use max_connections set to 1024 I had to raise the following values in the kernel: options SHMMAXPGS=3D327680 options SEMMNI=3D200 options SEMMNS=3D1200 options SEMUME=3D200 options SEMMNU=3D600 The values were taken from the postgresql-ports-installation-notes and were simply increased to fit the max_connections-parameter in postgresql.conf. Will more RAM become available to postgresql if I change the kernel-values mentioned above to half the size? The server does occasionally become loaded with load-averages around 6 or 7 but usually stays below 4. Disk-io is not a problem, usually remains below 1 MB/s, cpu-idle is approx. 5-10 % during peak and around 80 % idle otherwise. regards Claus