Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 34843633785 for ; Thu, 24 Jun 2010 15:38:07 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 31893-04 for ; Thu, 24 Jun 2010 18:37:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.illumen.com (unknown [64.207.29.137]) by mail.postgresql.org (Postfix) with ESMTP id B6F40633789 for ; Thu, 24 Jun 2010 15:37:59 -0300 (ADT) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: Re: cpu bound postgresql setup. Date: Thu, 24 Jun 2010 12:37:57 -0600 Message-ID: In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PERFORM] cpu bound postgresql setup. Thread-Index: AcsTwo+0B8pFG92iSkm0hnaMJ3hp6QACXc4g References: <4C220163020000250003291B@gw.wicourts.gov><4C22096E020000250003292B@gw.wicourts.gov><4C220C2C0200002500032930@gw.wicourts.gov><4C23332E0200002500032A1C@gw.wicourts.gov> From: "Benjamin Krajmalnik" To: "Rajesh Kumar Mallah" , "Kevin Grittner" Cc: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.792 tagged_above=-10 required=5 tests=BAYES_20=-0.001, RDNS_NONE=0.793 X-Spam-Level: X-Archive-Number: 201006/438 X-Sequence-Number: 39294 Rajesh, I had a similar situation a few weeks ago whereby performance all of a sudden decreased. The one tunable which resolved the problem in my case was increasing the number of checkpoint segments. After increasing them, everything went back to its normal state. > -----Original Message----- > From: pgsql-performance-owner@postgresql.org [mailto:pgsql-performance- > owner@postgresql.org] On Behalf Of Rajesh Kumar Mallah > Sent: Thursday, June 24, 2010 11:27 AM > To: Kevin Grittner > Cc: pgsql-performance@postgresql.org > Subject: Re: [PERFORM] cpu bound postgresql setup. >=20 > >i do not remember well but there is a system view that (i think) > >guides at what stage the marginal returns of increasing it > >starts disappearing , i had set it a few years back. >=20 > Sorry the above comment was regarding setting shared_buffers > not effective_cache_size. >=20 >=20 >=20 > On Thu, Jun 24, 2010 at 10:55 PM, Rajesh Kumar Mallah > wrote: > > On Thu, Jun 24, 2010 at 8:57 PM, Kevin Grittner > > wrote: > >> I'm not clear whether you still have a problem, or whether the > >> changes you mention solved your issues. I'll comment on potential > >> issues that leap out at me. > > > > It shall require more observation to know if the "problem" is solved. > > my "problem" was high load average in the server . We find that > > when ldavg is between 10-20 responses of applications were acceptable > > ldavg > 40 makes things slower. > > > > What prompted me to post to list is that the server transitioned from > > being IO bound to CPU bound and 90% of syscalls being > > lseek(XXX, 0, SEEK_END) =3D YYYYYYY > > > >> > >> Rajesh Kumar Mallah wrote: > >> > >>> 3. we use xfs and our controller has BBU , we changed = barriers=3D1 > >>> to barriers=3D0 as i learnt that having barriers=3D1 on xfs and = fsync > >>> as the sync method, the advantage of BBU is lost unless barriers > >>> is =3D 0 (correct me if my understanding is wrong) > >> > >> We use noatime,nobarrier in /etc/fstab. I'm not sure where you're > >> setting that, but if you have a controller with BBU, you want to set > >> it to whichever disables write barriers. > > > > as per suggestion in discussions on some other thread I set it > > in /etc/fstab. > > > >> > >>> max_connections =3D 300 > >> > >> As I've previously mentioned, I would use a connection pool, in > >> which case this wouldn't need to be that high. > > > > We do use connection pooling provided to mod_perl server > > via Apache::DBI::Cache. If i reduce this i *get* "too many > > connections from non-superuser ... " error. Will pgpool - I/II > > still applicable in this scenario ? > > > > > >> > >>> work_mem =3D 4GB > >> > >> That's pretty high. That much memory can be used by each active > >> connection, potentially for each of several parts of the active > >> query on each connection. You should probably set this much lower > >> in postgresql.conf and boost it if necessary for individual queries. > > > > hmmm.. it was 8GB for many months ! > > > > i shall reduce it further, but will it not result in usage of too > many > > temp files > > and saturate i/o? > > > > > > > >> > >>> effective_cache_size =3D 18GB > >> > >> With 32GB RAM on the machine, I would probably set this higher -- > >> somewhere in the 24GB to 30GB range, unless you have specific > >> reasons to believe otherwise. It's not that critical, though. > > > > i do not remember well but there is a system view that (i think) > > guides at what stage the marginal returns of increasing it > > starts disappearing , i had set it a few years back. > > > > > >> > >>> add_missing_from =3D on > >> > >> Why? There has been discussion of eliminating this option -- do you > >> have queries which rely on the non-standard syntax this enables? > > > > unfortunately yes. > > > >> > >>> Also i would like to apologize that some of the discussions on > >>> this problem inadvertently became private between me & kevin. > >> > >> Oops. I failed to notice that. Thanks for bringing it back to the > >> list. (It's definitely in your best interest to keep it in front of > >> all the other folks here, some of whom regularly catch things I miss > >> or get wrong.) > >> > >> If you still do have slow queries, please follow up with details. > > > > > > I have now set log_min_duration_statement =3D 5000 > > and there are few queries that come to logs. > > > > please comment on the connection pooling aspect. > > > > Warm Regards > > Rajesh Kumar Mallah. > > > >> > >> -Kevin > >> > > >=20 > -- > Sent via pgsql-performance mailing list (pgsql- > performance@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-performance