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 From owner-freebsd-performance@FreeBSD.ORG Thu Aug 4 17:45:08 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 D4DF416A41F for ; Thu, 4 Aug 2005 17:45:08 +0000 (GMT) (envelope-from sean@noc-phone.gigave.com) Received: from mailhost.gigave.com (mailhost.gigave.com [38.113.228.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id B37DF43D49 for ; Thu, 4 Aug 2005 17:45:08 +0000 (GMT) (envelope-from sean@noc-phone.gigave.com) Date: Thu, 4 Aug 2005 10:45:08 -0700 From: Sean Chittenden To: Claus Guttesen Message-ID: <20050804174508.GA70123@sean.gigave.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Cc: freebsd-performance@freebsd.org Subject: Re: changing max_connections in postgresql on FreeBSD 5.4 X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Aug 2005 17:45:09 -0000 > 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=327680 > options SEMMNI=200 > options SEMMNS=1200 > options SEMUME=200 > options SEMMNU=600 > > 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? Yes, it will raise the in-kernel limits so that PostgreSQL can allocate more RAM for its user-land cache. You will probably have a better ROI in terms of performance by increasing the kernel's caching parameters as opposed to PostgreSQL's cache. You need both, don't get me wrong, but there is lots of performance to be gained by increasing the amount of caching the kernel does. -sc -- Sean Chittenden From owner-freebsd-performance@FreeBSD.ORG Thu Aug 4 17:49:36 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 F24D816A41F for ; Thu, 4 Aug 2005 17:49:35 +0000 (GMT) (envelope-from bmw@borderware.com) Received: from mail.borderware.com (mail.borderware.com [207.236.65.231]) by mx1.FreeBSD.org (Postfix) with ESMTP id 797B343D45 for ; Thu, 4 Aug 2005 17:49:34 +0000 (GMT) (envelope-from bmw@borderware.com) Message-ID: <42F25526.5030002@borderware.com> Date: Thu, 04 Aug 2005 13:49:26 -0400 From: Bruce Walker Organization: BorderWare Technologies Inc. User-Agent: Mozilla Thunderbird 1.0.6 (Macintosh/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Sean Chittenden References: <20050804174508.GA70123@sean.gigave.com> In-Reply-To: <20050804174508.GA70123@sean.gigave.com> Content-Type: multipart/mixed; boundary="------------080704000904040802050609" X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-performance@freebsd.org Subject: Re: changing max_connections in postgresql on FreeBSD 5.4 X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Aug 2005 17:49:36 -0000 This is a multi-part message in MIME format. --------------080704000904040802050609 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sean Chittenden wrote: >>Will more RAM become available to postgresql if I change the >>kernel-values mentioned above to half the size? >> >> > >Yes, it will raise the in-kernel limits so that PostgreSQL can >allocate more RAM for its user-land cache. > >You will probably have a better ROI in terms of performance by >increasing the kernel's caching parameters as opposed to PostgreSQL's >cache. You need both, don't get me wrong, but there is lots of >performance to be gained by increasing the amount of caching the >kernel does. -sc > > Any generally good rules of thumb you could share? Which kernel caching are you referring to (ie disk, ...) ? Thanks! --------------080704000904040802050609-- From owner-freebsd-performance@FreeBSD.ORG Thu Aug 4 19:13:12 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 724F716A41F for ; Thu, 4 Aug 2005 19:13:12 +0000 (GMT) (envelope-from sean@noc-phone.gigave.com) Received: from mailhost.gigave.com (mailhost.gigave.com [38.113.228.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4ABB643D49 for ; Thu, 4 Aug 2005 19:13:12 +0000 (GMT) (envelope-from sean@noc-phone.gigave.com) Date: Thu, 4 Aug 2005 12:13:12 -0700 From: Sean Chittenden To: Bruce Walker Message-ID: <20050804191312.GF70123@sean.gigave.com> References: <20050804174508.GA70123@sean.gigave.com> <42F25526.5030002@borderware.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42F25526.5030002@borderware.com> Cc: freebsd-performance@freebsd.org Subject: Re: changing max_connections in postgresql on FreeBSD 5.4 X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Aug 2005 19:13:12 -0000 > >>Will more RAM become available to postgresql if I change the > >>kernel-values mentioned above to half the size? > > > >Yes, it will raise the in-kernel limits so that PostgreSQL can > >allocate more RAM for its user-land cache. > > > >You will probably have a better ROI in terms of performance by > >increasing the kernel's caching parameters as opposed to > >PostgreSQL's cache. You need both, don't get me wrong, but there > >is lots of performance to be gained by increasing the amount of > >caching the kernel does. -sc > > Any generally good rules of thumb you could share? Which kernel > caching are you referring to (ie disk, ...) ? Hrm... I'll suggest one tunable: options KSTACK_MAX_PAGES=32 # Maximum pages to give the kernel stack Don't crank it up too far, but 64 seems to be a decent number in my experience. I'd pimp more settings, but given that tuning is still closer to an art than a science (it wouldn't be if someone catalogued settings for various applications and hardware combinations, but I digress), I'll suggest having you take a peak at the various NOTES files and some of the headers, such as: src/sys/amd64/include/param.h. I've divulged more in the archives, too. -sc -- Sean Chittenden From owner-freebsd-performance@FreeBSD.ORG Sat Aug 6 13:25:26 2005 Return-Path: X-Original-To: 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 5E9A416A41F for ; Sat, 6 Aug 2005 13:25:26 +0000 (GMT) (envelope-from gnn@neville-neil.com) Received: from mrout2-b.corp.dcn.yahoo.com (mrout2-b.corp.dcn.yahoo.com [216.109.112.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0A99643D49 for ; Sat, 6 Aug 2005 13:25:25 +0000 (GMT) (envelope-from gnn@neville-neil.com) Received: from minion.local.neville-neil.com (proxy8.corp.yahoo.com [216.145.48.13]) by mrout2-b.corp.dcn.yahoo.com (8.13.4/8.13.4/y.out) with ESMTP id j76DP3IH025579 for ; Sat, 6 Aug 2005 06:25:04 -0700 (PDT) Date: Sat, 06 Aug 2005 22:25:11 +0900 Message-ID: From: gnn@freebsd.org To: performance@freebsd.org User-Agent: Wanderlust/2.12.2 (99 Luftballons) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 Emacs/21.3.50 (powerpc-apple-darwin8.1.0) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: Subject: Tarball of ported libmicro 0.3 available for testing... X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Aug 2005 13:25:26 -0000 Hi Folks, So, the Open Solaris folks released their OS micro benchmarks and I have hacked (in the best and worst way of saying that) the code to run on FreeBSD -CURRENT. I have only just tried this on a nightly build that it less than a week old. There isn't a lot of documentation at: http://www.opensolaris.org/os/community/performance/libmicro/ but it should be easy enough to figure out the gist of each test. Tests that required shared pthread mutexes and condition variables do not work and are listed as elided in the Makefile.FreeBSD. The code requires gmake to build. Just unpack the tarball, cd in to the unpacked root directory, type "gmake" and then "./bench" when the make is finished and the test will run. The tarball is here: http://www.codespelunking.org/downloads/libMicro.tar.gz I plan to make a port of this this weekend, but would like some feedback on this set of benchmarks. If they're useful I think we should make them part of a nightly benchmarking strategy. They are released under the CDDL (Solaris's open source license) so I'll need to know from someone what the issues are with that and ports. Of course I'll feed my mods back to the authors, but other issues might crop up. Later, George From owner-freebsd-performance@FreeBSD.ORG Sat Aug 6 14:51:48 2005 Return-Path: X-Original-To: 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 38A6016A41F; Sat, 6 Aug 2005 14:51:48 +0000 (GMT) (envelope-from cswiger@mac.com) Received: from pi.codefab.com (pi.codefab.com [199.103.21.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id ECCA943D45; Sat, 6 Aug 2005 14:51:41 +0000 (GMT) (envelope-from cswiger@mac.com) Received: from localhost (localhost [127.0.0.1]) by pi.codefab.com (Postfix) with ESMTP id 18C615CF8; Sat, 6 Aug 2005 10:51:41 -0400 (EDT) Received: from pi.codefab.com ([127.0.0.1]) by localhost (pi.codefab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 55342-07; Sat, 6 Aug 2005 10:51:29 -0400 (EDT) Received: from [192.168.1.3] (pool-68-161-79-217.ny325.east.verizon.net [68.161.79.217]) by pi.codefab.com (Postfix) with ESMTP id 7A7D75C46; Sat, 6 Aug 2005 10:51:29 -0400 (EDT) Message-ID: <42F4CE75.8050201@mac.com> Date: Sat, 06 Aug 2005 10:51:33 -0400 From: Chuck Swiger Organization: The Courts of Chaos User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.11) Gecko/20050801 X-Accept-Language: en-us, en MIME-Version: 1.0 To: gnn@freebsd.org References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at codefab.com Cc: performance@freebsd.org Subject: Re: Tarball of ported libmicro 0.3 available for testing... X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Aug 2005 14:51:48 -0000 gnn@freebsd.org wrote: > [ ... ] The tarball is here: > > http://www.codespelunking.org/downloads/libMicro.tar.gz > > I plan to make a port of this this weekend, but would like some > feedback on this set of benchmarks. If they're useful I think we > should make them part of a nightly benchmarking strategy. Very nice. There seems to be good coverage of common tasks, and the ability to save and compare multiple datasets via the tool which generates HTML makes understanding the results relatively easy. It would be quite interesting to compare a kernel built with and without INVARIANTS, WITNESS, and so forth. By the way, this runs fine on 5.x, and seems to only need minor changes to go on 4.x as well using libc_r rather than -lposix. (All but two or three of the microbenchmarks compile and run...) > They are released under the CDDL (Solaris's open source license) so > I'll need to know from someone what the issues are with that and > ports. Of course I'll feed my mods back to the authors, but other > issues might crop up. The CDDL is a well-crafted Open Source license with strong patent protections; it closely resembles the MPL and is free, fair, but not GPL-miscable. There shouldn't be any particular issues including it in ports or using it with BSD-licensed code. I'm not sure what else one could say about it, nevertheless this link: http://www.opensolaris.org/os/about/faq/licensing_faq/ ...has more information. Did you have a more specific question? :-) -- -Chuck From owner-freebsd-performance@FreeBSD.ORG Sat Aug 6 15:19:44 2005 Return-Path: X-Original-To: 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 B79B516A41F for ; Sat, 6 Aug 2005 15:19:44 +0000 (GMT) (envelope-from gnn@neville-neil.com) Received: from mrout2.yahoo.com (mrout2.yahoo.com [216.145.54.172]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4A88E43D7D for ; Sat, 6 Aug 2005 15:19:44 +0000 (GMT) (envelope-from gnn@neville-neil.com) Received: from minion.local.neville-neil.com (proxy8.corp.yahoo.com [216.145.48.13]) by mrout2.yahoo.com (8.13.4/8.13.4/y.out) with ESMTP id j76FJKk1036181; Sat, 6 Aug 2005 08:19:21 -0700 (PDT) Date: Sun, 07 Aug 2005 00:19:29 +0900 Message-ID: From: gnn@FreeBSD.org To: Chuck Swiger In-Reply-To: <42F4CE75.8050201@mac.com> References: <42F4CE75.8050201@mac.com> User-Agent: Wanderlust/2.12.2 (99 Luftballons) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 Emacs/21.3.50 (powerpc-apple-darwin8.1.0) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: performance@FreeBSD.org Subject: Re: Tarball of ported libmicro 0.3 available for testing... X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Aug 2005 15:19:44 -0000 At Sat, 06 Aug 2005 10:51:33 -0400, Chuck Swiger wrote: > Very nice. There seems to be good coverage of common tasks, and the > ability to save and compare multiple datasets via the tool which > generates HTML makes understanding the results relatively easy. It > would be quite interesting to compare a kernel built with and > without INVARIANTS, WITNESS, and so forth. > > By the way, this runs fine on 5.x, and seems to only need minor > changes to go on 4.x as well using libc_r rather than -lposix. (All > but two or three of the microbenchmarks compile and run...) Thanks for testing it on 5.x, that's good to know. I've been putting together a port for it. Should have that ready by the end of the weekend. As to what setups to test, there are many and certainly your suggestions will be in the list of targets built and tested. The scripts to do that I have not written yet, but should not be hard. My plan is to make it so you can just run nightly performance tests, if you would like. > > They are released under the CDDL (Solaris's open source license) > > so I'll need to know from someone what the issues are with that > > and ports. Of course I'll feed my mods back to the authors, but > > other issues might crop up. > > The CDDL is a well-crafted Open Source license with strong patent > protections; it closely resembles the MPL and is free, fair, but not > GPL-miscable. There shouldn't be any particular issues including it > in ports or using it with BSD-licensed code. > > I'm not sure what else one could say about it, nevertheless this > link: > > http://www.opensolaris.org/os/about/faq/licensing_faq/ > > ...has more information. Did you have a more specific question? > :-) No, nothing specific. Just wondering about inclusion in ports, and you've answered that. I'm not worried about patents either. Thanks, George