Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TsHQf-000197-DB for pgsql-performance@arkaria.postgresql.org; Mon, 07 Jan 2013 18:28:10 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TsHQe-00022R-Rk for pgsql-performance@arkaria.postgresql.org; Mon, 07 Jan 2013 18:28:08 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TsHQc-00020j-PK for pgsql-performance@postgresql.org; Mon, 07 Jan 2013 18:28:07 +0000 Received: from mh2.mail.rice.edu ([128.42.201.21]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TsHQa-0007TV-GT for pgsql-performance@postgresql.org; Mon, 07 Jan 2013 18:28:05 +0000 Received: from mh2.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh2.mail.rice.edu (Postfix) with ESMTP id EA0F8500134; Mon, 7 Jan 2013 12:28:03 -0600 (CST) Received: from mh2.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh2.mail.rice.edu (Postfix) with ESMTP id E91A1500129; Mon, 7 Jan 2013 12:28:03 -0600 (CST) X-Virus-Scanned: by amavis-2.7.0 at mh2.mail.rice.edu, auth channel Received: from mh2.mail.rice.edu ([127.0.0.1]) by mh2.mail.rice.edu (mh2.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id iIRRN6rlkBbJ; Mon, 7 Jan 2013 12:28:03 -0600 (CST) X-SMTP-Auth: no X-SMTP-Auth: no Received: from aart.rice.edu (aart.rice.edu [168.7.56.48]) by mh2.mail.rice.edu (Postfix) with ESMTP id CC6FA500116; Mon, 7 Jan 2013 12:28:03 -0600 (CST) Received: by aart.rice.edu (Postfix, from userid 18612) id 57404100191; Mon, 7 Jan 2013 12:28:11 -0600 (CST) Date: Mon, 7 Jan 2013 12:28:11 -0600 From: "ktm@rice.edu" To: Patrick Dung Cc: pgsql-performance@postgresql.org Subject: Re: Sub optimal performance with default setting of Postgresql with FreeBSD 9.1 on ZFS Message-ID: <20130107182811.GR14743@aart.rice.edu> References: <1357572772.78036.YahooMailClassic@web190801.mail.sg3.yahoo.com> <1357579082.78674.YahooMailClassic@web190804.mail.sg3.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1357579082.78674.YahooMailClassic@web190804.mail.sg3.yahoo.com> User-Agent: Mutt/1.5.20 (2009-12-10) X-Pg-Spam-Score: -4.2 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Hi Patrick, You really need a flash ZIL with ZFS to handle syncs effectively. Setting the sync_commit to off is the best you can do without it. Not that that is bad, we do that here as well. Regards, Ken On Tue, Jan 08, 2013 at 01:18:02AM +0800, Patrick Dung wrote: > Hi, > > Updated information in this post. > > I have installed Postgresql 9.2.2 (complied by gcc) in FreeBSD 9.1 i386. > The pgsql base directory is in a ZFS dataset. > > I > have noticed the performance is sub-optimal, but I know the default > setting should be the most safest one to be use (without possible data > corruption/loss). > > a) I use OTRS ticketing system version 3.1, the backend is PostgreSQL. > The user interactive response is not slow (switching web pages or create a change). > > b) There is a benchmark in the support module of OTRS. > It tested insert,update,select and delete performance. > The response time is slow (>10 sec), except select. > > I have done some research on web, with below settings (just one change, not both), the performance returned to normal: > > 1) Disabled sync in the pgsql dataset in ZFS > zfs set sync=disabled mydata/pgsql > or > 2) In > postgresql.conf, set synchronous_commit from on to off > > I know the above setting would lead to data loss (e.g.power goes off), any comments? > > PS: > 1) I have tried to use primarycache/secondarycache=metadata/none, it do not seem to help. > > 2) > I have tried the default setting on Linux too: > RHEL 6.3, ext4, stock postgresql 8.x, OTRS 3.1. > The web site is responsive and the benchmark result is more or less the same as FreeBSD with the 'sync' turned off. > > 3) > For FreeBSD, same setting with Postgresql on UFS: > The performance is between ZFS (default, sync enabled) and ZFS (sync disabled). > > Thanks, > Patrick > > --- On Mon, 1/7/13, Patrick Dung wrote: > > From: Patrick Dung > Subject: Sub optimal performance with default setting of Postgresql with FreeBSD 9.1 on ZFS > To: pgsql-performance@postgresql.org > Date: Monday, January 7, 2013, 11:32 PM > > Hi, > > I have installed Postgresql 9.2.2 (complied by gcc) in FreeBSD 9.1 i386. > The pgsql base directory is in a ZFS dataset. > > I have noticed the performance is sub-optimal, but I know the default setting should be the most safest one to be use (without possible data corruption/loss). > > a) I use OTRS ticketing system, the backend is PostgreSQL. > The user interactive response is not slow (switching web pages or create a change). > > b) There is a benchmark in the support module of OTRS. > It tested insert,update,select and delete performance. > The response time is slow (>10 sec), except select. > > I have done some research on web, with below settings (just one change, not both), the performance returned to normal: > > 1) Disabled sync in the pgsql dataset in ZFS > zfs set sync=disabled mydata/pgsql > or > 2) In > postgresql.conf, set synchronous_commit from on to off > > I know the above setting would lead to data loss (e.g.power goes off), any comments? > > PS: > 1) I have tried to use primarycache/secondarycache=metadata/none, it do not seem to help. > > 2) > I have tried the default setting on Linux too: > RHEL 6.3, stock postgresql 8.x, OTRS 3.1. > The web site is responsive and the benchmark result is more or less the same as FreeBSD with the 'sync' turned off. > > Thanks, > Patrick -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance