Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 6530D64FCEE for ; Mon, 13 Oct 2008 11:49:49 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 78807-02 for ; Mon, 13 Oct 2008 11:49:45 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from h7.zynet2.co.uk (h7.zynet2.co.uk [212.24.80.7]) by postgresql.org (Postfix) with ESMTP id 65C1A64FCCE for ; Mon, 13 Oct 2008 11:49:44 -0300 (ADT) Received: from h93.zynet2.co.uk (h93.zynet2.co.uk [212.24.80.93]) by h7.zynet2.co.uk (Postfix) with ESMTP id D41C645D4BD for ; Mon, 13 Oct 2008 15:49:34 +0100 (BST) Received: from h66.zynet2.co.uk (h66.zynet2.co.uk [212.24.80.66]) (Authenticated sender: simon) by h93.zynet2.co.uk (Postfix) with ESMTP id BF936579944 for ; Mon, 13 Oct 2008 15:49:34 +0100 (BST) From: Simon Waters Organization: ZyNet Limited To: pgsql-performance@postgresql.org Subject: Re: [GENERAL] Drupal and PostgreSQL - performance issues? Date: Mon, 13 Oct 2008 15:49:33 +0100 User-Agent: KMail/1.9.9 References: <2434A118-CEFA-43A9-BA88-006EC1F80326@hoegh.org> <06DDE07E-3CF9-4B3E-8536-7C164BAB8FC6@hoegh.org> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200810131549.33863.simonw@zynet.net> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200810/66 X-Sequence-Number: 31647 On Monday 13 October 2008 15:19:07 Scott Marlowe wrote: > > > shared_buffers = 24MB > > max_fsm_pages = 153600 > > Well, 24MB is pretty small. See if you can increase your system's > shared memory and postgresql's shared_buffers to somewhere around 256M > to 512M. It likely won't make a big difference in this scenario, but > overall it will definitely help. I noted after reading earlier messages in the thread, that my distro documents that the values it default to for shared_buffers is rather small. One of our servers is fairly pressed for memory (some of the time). Is there any way to measure the amount of churn in the shared_buffers, as a way of demonstrating that more is needed (or at this moment more would help)? A few very small databases on this server, and one which is 768M (still pretty small but a lot bigger than the rest, most of which is logging information). The only "hot" information is the session table, ~9000 lines, one index on the session id. Can I ask Postgres to tell me, or estimate, how much memory this table would occupy if fully cached in memory? Half the problem in modern computing is knowing what is "slow". In this case, counting the rows of the session table takes about 100ms. Deleting expired session rows about 120ms, more if it hasn't done it for a while, which is I guess evidence that table isn't being cached in memory as efficiency as it could be. In this case the server thinks the system I/O is zero for half the tools in use, because of the RAID hardware, so most of the Linux based tools are useless in this context. At the risk of thread hijacking, for the session table I wonder if we are handling it the most efficient way. It is just a regular table, indexed on session_id. Each request of note to the server requires retrieval of the session record, and often updating the expiry information. Every N requests the application also issues a: DELETE FROM sessions WHERE expires