Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TjaLC-0006Zt-4w for pgsql-admin@arkaria.postgresql.org; Fri, 14 Dec 2012 18:50:34 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TjaLB-0000J6-8d for pgsql-admin@arkaria.postgresql.org; Fri, 14 Dec 2012 18:50:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TjaLA-0000J0-A2 for pgsql-admin@postgresql.org; Fri, 14 Dec 2012 18:50:32 +0000 Received: from mailout-us.gmx.com ([74.208.5.67]) by magus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TjaL6-0002uw-Vt for pgsql-admin@postgresql.org; Fri, 14 Dec 2012 18:50:32 +0000 Received: (qmail 21889 invoked by uid 0); 14 Dec 2012 18:50:26 -0000 Received: from 76.255.19.161 by rms-us001 with HTTP Content-Type: text/plain; charset="utf-8" Date: Fri, 14 Dec 2012 13:50:25 -0500 From: "Kevin Grittner" Message-ID: <20121214185025.80080@gmx.com> MIME-Version: 1.0 Subject: Re: PostgreSQL Performance Tuning / Postgresql.conf and on OS Level To: "Shams Khan" ,pgsql-admin@postgresql.org X-Authenticated: #138763884 X-Flags: 0001 X-Mailer: GMX.com Web Mailer x-registered: 0 Content-Transfer-Encoding: 8bit X-GMX-UID: phG5cCx+3zOlOQ09Lnwhx4N+IGRvb4BG X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org Shams Khan wrote: > *Need to increase the response time of running queries on > server...* > 8 CPU's and 16 cores > [64GB RAM] > HDD 200GB > Database size = 40GB Without more info, there's a bit of guesswork, but... > maintenance_work_mem = Not initialised I would say probably 1GB > effective_cache_size = Not initialised 48GB > work_mem = Not initialised You could probably go 100MB on this. > wal_buffers = 8MB 16BM > checkpoint_segments = 16 Higher. Probably not more than 128. > shared_buffers = 32MB (have read should 20% of Physical memory) 16GB to start. If you have episodes of high latency, where even queries which normally run very quickly all pause and then all complete close together after a delay, you may need to reduce this and/or increase the aggressiveness of the background writer. I've had to go as low as 1GB to overcome such latency spikes. > max_connections = 100 Maybe leave alone, possibly reduce. You should be aiming to use a pool to keep about 20 database connections busy. If you can't do that in the app, look at pgbouncer. >  checkpoint_completion_target = Not initialised It is often wise to increase this to 0.8 or 0.9 If I read this right, you have one 200GB drive for writes? That's going to be your bottleneck if you write much data. You need a RAID for both performance and reliability, with a good controller with battery-backed cache configured for write-back. Until you have one you can be less crippled on preformance by setting synchronous_commit = off. The trade-off is that there will be a slight delay between when PostgreSQL acknoleges a commit and when the data is actually persisted. -Kevin -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin