Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X9KYY-0006py-6k for pgsql-admin@arkaria.postgresql.org; Mon, 21 Jul 2014 20:51:34 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1X9KYX-0006sg-10 for pgsql-admin@arkaria.postgresql.org; Mon, 21 Jul 2014 20:51:33 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X9KYV-0006sS-LZ for pgsql-admin@postgresql.org; Mon, 21 Jul 2014 20:51:32 +0000 Received: from nm3-vm1.bullet.mail.ne1.yahoo.com ([98.138.91.53]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X9KYN-0007VY-R0 for pgsql-admin@postgresql.org; Mon, 21 Jul 2014 20:51:29 +0000 Received: from [98.138.100.111] by nm3.bullet.mail.ne1.yahoo.com with NNFMP; 21 Jul 2014 20:51:21 -0000 Received: from [98.138.89.162] by tm100.bullet.mail.ne1.yahoo.com with NNFMP; 21 Jul 2014 20:51:21 -0000 Received: from [127.0.0.1] by omp1018.mail.ne1.yahoo.com with NNFMP; 21 Jul 2014 20:51:21 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 593954.9668.bm@omp1018.mail.ne1.yahoo.com Received: (qmail 27105 invoked by uid 60001); 21 Jul 2014 20:51:21 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymail.com; s=s1024; t=1405975881; bh=TMtQsQNmpHvSYxv2BwieBYjxAr9ullhPANR8UkeJAgE=; h=References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=ph+MXW7kps0deEaZhc+d9d9Wbj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BpcyBvdXQgb2Ygc3VwcG9ydC7CoCBJZiB5b3UgYXJlIGF0IGFsbCBjb25jZXJuZWQgYWJvdXQKcGVyZm9ybWFuY2UsIHlvdSB3b3VsZCBkbyB3ZWxsIHRvIHVwZ3JhZGUgdG8gYSByZWNlbnQgYW5kCnN1cHBvcnRlZCBtYWpvciByZWxlYXNlLgoKaHR0cDovL3d3dy5wb3N0Z3Jlc3FsLm9yZy9zdXBwb3J0L3ZlcnNpb25pbmcvCgpBbnl3YXksIGl0IGkBMAEBAQE- X-Mailer: YahooMailWebService/0.8.195.680 References: Message-ID: <1405975881.98993.YahooMailNeo@web122303.mail.ne1.yahoo.com> Date: Mon, 21 Jul 2014 13:51:21 -0700 From: Kevin Grittner Reply-To: Kevin Grittner Subject: Re: [GENERAL] Checkpoint_segments optimal value To: Prabhjot Sheena , "pgsql-admin@postgresql.org" , Forums postgresql In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -2.0 (--) 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 Prabhjot Sheena wrote: > I m running postgresql 8.3 That is out of support.=A0 If you are at all concerned about performance, you would do well to upgrade to a recent and supported major release. http://www.postgresql.org/support/versioning/ Anyway, it is always a good idea to show the output of: SELECT version(); > temp_buffers =3D 64MB You don't say what you have set for max_connections, but temp_buffers is allocated at need *separately for each connection* and once allocated to a connection it is never released until the connection is closed.=A0 So, hypothetically, if you had 100 connections open and they each had used temporary tables at some time or other, even when all are idle they could have 6.4GB of your 12GB of RAM tied up. > work_mem =3D 512MB Unlike temp_buffers, this one is released at the end of the command (or earlier), but it is possible to have multiple allocations for a single connection.=A0 If you had 100 queries active, each using one work_mem allocation, that would allocate about 51.2GB of RAM, which looks like it is more than you have.=A0 I generally recommend setting max_connections only to what is needed (with a small reserve) and setting work_mem to 25% of machine (or VM) RAM divided by max_connections. On the face of it, neither of the above seems to be causing problems at the time you ran vmstat, but they worry me. > max_fsm_pages =3D 809600 Since the EXPLAIN ANALYZE output you later posted show estimates=20 which were off by several orders of magnitude, quite possibly=20 leading to a suboptimal plan, you should probably run queries to=20 check for bloat and update statistics.=A0 If you find badly bloated=20 tables you should run CLUSTER or VACUUM FULL on them to eliminate=20 bloat.=A0 Any bloated indexes, and any indexed on bloated tables you=20 cleaned up using VACUUM FULL should be fixed with REINDEX.=A0 (Once=20 you are on 9.0 or later it is no longer necessary to REINDEX a=20 table after using VACUUM FULL on it, although a regular VACUUM=20 after the VACUUM FULL is still important.)=A0 If you find bloat you=20 should make autovacuum more aggressive or add VACUUM ANALYZE=20 crontab jobs, to prevent a recurrence. You may want to look at increasing statistics targets, either globally or on specific columns used for selection criteria. After doing the above, or if you decide not to do any or all of it, you should probably run EXPLAIN ANALYZE VERBOSE; (without specifying a table name and without the FULL option) and review the output.=A0 The most important part of the output is the last few=20 lines, which in 8.3 might include warnings that suggest=20 configuration changes. The above might help, but I think the biggest problem may be your VM.=A0 You show very low disk I/O numbers, but a pretty significant fraction of the time waiting for I/O.=A0 The previously-suggested iostat output may help nail it down more specifically, but basically you seem to have a big problem with bandwidth for storage access.=A0 It's pretty disturbing to see lines in vmstat output which=20 show zero disk in or out, but over 10% of CPU time waiting for=20 storage?!? -- Kevin Grittner EDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company --=20 Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin