X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id EAE4752816 for ; Thu, 26 May 2005 18:14:50 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 56653-07 for ; Thu, 26 May 2005 21:14:41 +0000 (GMT) Received: from server07.icaen.uiowa.edu (server07.icaen.uiowa.edu [128.255.17.47]) by svr1.postgresql.org (Postfix) with ESMTP id 7AA7952851 for ; Thu, 26 May 2005 18:14:40 -0300 (ADT) Received: from server11.icaen.uiowa.edu (server11.icaen.uiowa.edu [128.255.17.51]) by server07.icaen.uiowa.edu (8.13.3/8.12.9) with ESMTP id j4QLEbeZ011685; (envelope-from ) Thu, 26 May 2005 16:14:37 -0500 (CDT) Received: from [192.168.1.13] (12-215-118-172.client.mchsi.com [12.215.118.172]) (authenticated user=jfmeinel) by server11.icaen.uiowa.edu (8.13.2/smtp-serv-1.7) with ESMTP id j4QLEZSJ028530 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256); (envelope-from ) Thu, 26 May 2005 16:14:36 -0500 (CDT) Message-ID: <42963C3F.4000905@arbash-meinel.com> Date: Thu, 26 May 2005 16:14:39 -0500 From: John Arbash Meinel User-Agent: Mozilla Thunderbird 1.0.2 (Macintosh/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Josh Close Cc: pgsql-performance@postgresql.org Subject: Re: slow queries, possibly disk io References: <4a0cafe205052613242e0d4d10@mail.gmail.com> In-Reply-To: <4a0cafe205052613242e0d4d10@mail.gmail.com> X-Enigmail-Version: 0.91.0.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig38D8EBB5F435572FB2B6B607" X-Virus-Scanned: ClamAV version 0.83, clamav-milter version 0.83 on clamav.icaen.uiowa.edu X-Virus-Scanned: ClamAV version 0.83, clamav-milter version 0.83 on clamav.icaen.uiowa.edu X-Virus-Status: Clean X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200505/403 X-Sequence-Number: 12567 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig38D8EBB5F435572FB2B6B607 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Josh Close wrote: >I have some queries that have significan't slowed down in the last >couple days. It's gone from 10 seconds to over 2 mins. > >The cpu has never gone over 35% in the servers lifetime, but the load >average is over 8.0 right now. I'm assuming this is probably due to >disk io. > >I need some help setting up postgres so that it doesn't need to go to >disk. I think the shared_buffers and effective_cache_size values are >the one's I need to look at. > >Would setting shmmax and smmall to 90% or so of available mem and >putting a lot for postgres be helpful? > > Setting shared buffers above something like 10-30% of memory is counter productive. >Effective cach size says this: >Sets the planner's assumption about the effective size of the disk >cache (that is, the portion of the kernel's disk cache that will be >used for PostgreSQL data files). > >Does that mean the total available ram? Or what's left over from shared_buffers? > >I've tried different things and not much has been working. Is there a >good way to ensure that most of the tables accessed in postgres will >be cached in mem and not have to go to disk? > >If I'm joining a lot of tables, should the sort_mem be set high also? >Do shared_buffers, effective_cache_size, and sort_mem all use >different mem? Or are they seperate? > > > Increasing sort_mem can help with various activities, but increasing it too much can cause you to swap, which kills performance. The caution is that you will likely use at least 1 sort_mem per connection, and can likely use more than one if the query is complicated. effective_cache_size changes how Postgres plans queries, but given the same query plan, it doesn't change performance at all. >I've looked for information and haven't found any useful pages about this. > >Any help would be greatly appreciated. > >Thanks. > >-Josh > > John =:-> --------------enig38D8EBB5F435572FB2B6B607 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCljw/JdeBCYSNAAMRAsdIAJ455/psugrOOp5AduN8YTvCuxmBawCgrXv5 YLtuRwtiRKGt+rSJkM4T3/c= =pyku -----END PGP SIGNATURE----- --------------enig38D8EBB5F435572FB2B6B607--