Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id CAF3F9FBF9C for ; Wed, 11 Jul 2007 12:35:57 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 12711-03 for ; Wed, 11 Jul 2007 12:35:46 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id C06E99FBE52 for ; Wed, 11 Jul 2007 12:35:48 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from mailout07.sul.t-online.com (mailout07.sul.t-online.de [194.25.134.83]) by svr4.postgresql.org (Postfix) with ESMTP id 102345AF88E for ; Wed, 11 Jul 2007 15:35:45 +0000 (GMT) Received: from fwd30.aul.t-online.de by mailout07.aul.t-online.de with smtp id 1I8eEB-0004al-02; Wed, 11 Jul 2007 17:35:43 +0200 Received: from [192.168.1.2] (XjyYbkZZgeb1qcS4g2OebO7rrLSIPgEBsC9l2FEuhCShkgd3oLhJZ0@[87.177.81.55]) by fwd30.aul.t-online.de with esmtp id 1I8eE4-1HHJDc0; Wed, 11 Jul 2007 17:35:36 +0200 Message-ID: <4694F8C5.2040005@p-dw.com> Date: Wed, 11 Jul 2007 17:35:33 +0200 From: Patric de Waha User-Agent: Thunderbird 1.5.0.12 (Windows/20070509) MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Two questions.. shared_buffers and long reader issue Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-ID: XjyYbkZZgeb1qcS4g2OebO7rrLSIPgEBsC9l2FEuhCShkgd3oLhJZ0@t-dialin.net X-TOI-MSGID: 5cfad926-c9e1-4775-a60a-27e8942a2442 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.2 tagged_above=0 required=5 tests=AWL=-1.198, BAYES_50=0.001, FH_HAS_XID=2.397 X-Spam-Level: * X-Archive-Number: 200707/90 X-Sequence-Number: 25774 Hi, I've two questions for which I not really found answers in the web. Intro: I've a Website with some traffic. 2 Million queries a day, during daylight. Postgres is running on a dedicated server P4 DualCore, 4 Gig Ram. Mainly updates on 1 tuple. And more or less complex SELECT statements. I noticed that the overall performance of postgres is decreasing when one or more long readers are present. Where a long reader here is already a Select count(*) from table. As postgres gets slower an slower, and users still hammering on the reload button to get their page loaded. Postgres begins to reach max connections, and web site is stuck. It's not because of a bad schema or bad select statements. As I said, a select count(*) on big table is already triggering this behaviour. Why do long readers influence the rest of the transactions in such a heavy way? Any configuration changes which can help here? Is it a disc-IO bottleneck thing? Second question. What is the right choice for the shared_buffers size? On a dedicated postgres server with 4 Giga RAM. Is there any rule of thumb? Actually I set it to +-256M. thanks for any suggestions. Patric My Setup: Debian Etch PSQL: 8.1.4 WAL files are located on another disc than the dbase itself. max_connections = 190 shared_buffers = 30000 temp_buffers = 3000 work_mem = 4096 maintenance_work_mem = 16384 fsync = on wal_buffers = 16 effective_cache_size = 5000