Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 690779FB872 for ; Mon, 11 Jun 2007 14:52:16 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 04399-01 for ; Mon, 11 Jun 2007 14:52:10 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.168]) by postgresql.org (Postfix) with ESMTP id 70E5E9FB7DB for ; Mon, 11 Jun 2007 14:52:11 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id u2so1686660uge for ; Mon, 11 Jun 2007 10:52:09 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=NfUvSY99JE/binzOa11XWuLpNhQf5xQR1hXejZKKC9MsAmCCPIzM6EyVxM6fw2CvAphQ+xWC5ECUrgnryuQI8K5FyJhptHuDRMUs9odzJDp+d3GlpdvAHQPjudzGCEhgUqIanyqzoWpFoI3/yEeggowHIeQwYEkyce+ySi+RnLY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=HuKum8IAwJMY6Yn5uuDcJ6QoffrSpD8z8XqwQabgDbHYYRXuuCHQe1pQ72dLweGRer7TNJOomMNVR1QAxIfukuAQHNzrNMpCMGZaIAl5bLIy1SSzKrjqrYnYRzW8PyRfFEnDRSb6wtMqYqRlgAbYAdvffRgS6yzZQMBttHT1ewM= Received: by 10.66.239.16 with SMTP id m16mr5287572ugh.1181584329790; Mon, 11 Jun 2007 10:52:09 -0700 (PDT) Received: from ?172.24.32.61? ( [62.232.55.118]) by mx.google.com with ESMTP id 53sm3806175ugd.2007.06.11.10.52.08 (version=SSLv3 cipher=RC4-MD5); Mon, 11 Jun 2007 10:52:08 -0700 (PDT) Message-ID: <466D8BAF.604@enterprisedb.com> Date: Mon, 11 Jun 2007 18:51:43 +0100 From: Heikki Linnakangas User-Agent: Icedove 1.5.0.10 (X11/20070329) MIME-Version: 1.0 To: Vladimir Stankovic CC: PostgreSQL Performance Subject: Re: Variable (degrading) performance References: <466D848F.2010505@city.ac.uk> In-Reply-To: <466D848F.2010505@city.ac.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/195 X-Sequence-Number: 25228 Vladimir Stankovic wrote: > I'm running write-intensive, TPC-C like tests. The workload consist of > 150 to 200 thousand transactions. The performance varies dramatically, > between 5 and more than 9 hours (I don't have the exact figure for the > longest experiment). Initially the server is relatively fast. It > finishes the first batch of 50k transactions in an hour. This is > probably due to the fact that the database is RAM-resident during this > interval. As soon as the database grows bigger than the RAM the > performance, not surprisingly, degrades, because of the slow disks. > My problem is that the performance is rather variable, and to me > non-deterministic. A 150k test can finish in approx. 3h30mins but > conversely it can take more than 5h to complete. > Preferably I would like to see *steady-state* performance (where my > interpretation of the steady-state is that the average > throughput/response time does not change over time). Is the steady-state > achievable despite the MVCC and the inherent non-determinism between > experiments? What could be the reasons for the variable performance? Steadiness is a relative; you'll never achieve perfectly steady performance where every transaction takes exactly X milliseconds. That said, PostgreSQL is not as steady as many other DBMS's by nature, because of the need to vacuum. Another significant source of unsteadiness is checkpoints, though it's not as bad with fsync=off, like you're running. I'd suggest using the vacuum_cost_delay to throttle vacuums so that they don't disturb other transactions as much. You might also want to set up manual vacuums for the bigger tables, instead of relying on autovacuum, because until the recent changes in CVS head, autovacuum can only vacuum one table at a time, and while it's vacuuming a big table, the smaller heavily-updated tables are neglected. > The database server version is 8.1.5 running on Fedora Core 6. How about upgrading to 8.2? You might also want to experiment with CVS HEAD to get the autovacuum improvements, as well as a bunch of other performance improvements. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com