Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 46C289FBFCF for ; Fri, 27 Apr 2007 19:51: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 70243-08 for ; Fri, 27 Apr 2007 19:51:52 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 7C3689FB688 for ; Fri, 27 Apr 2007 19:51:52 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id l3RMpaRY006666; Fri, 27 Apr 2007 18:51:38 -0400 (EDT) To: "Mauro N. Infantino" cc: pgsql-performance@postgresql.org Subject: Re: Very specific server situation In-reply-to: <01bc01c788f2$ef6475b0$ec01010a@intranet.db> References: <01bc01c788f2$ef6475b0$ec01010a@intranet.db> Comments: In-reply-to "Mauro N. Infantino" message dated "Fri, 27 Apr 2007 14:38:57 -0300" Date: Fri, 27 Apr 2007 18:51:36 -0400 Message-ID: <6665.1177714296@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/487 X-Sequence-Number: 24364 "Mauro N. Infantino" writes: > What we basically have is a site where each user has a box with links to > other randomly selected users. Whenever a box from a user is shown, a SPs is > executed: a credit is added to that user and a credit is substracted from > the accounts of the shown links. Accounts with no credits do not have to be > listed. So, we've lots (LOTS) of users querying and updating the same table. Have you checked to make sure the query plans are reasonable? Have you checked that autovacuum is running often enough? (You might want to try contrib/pgstattuple to see how much dead space there is in your heavily-updated tables.) Also, on a high-update workload it is absolutely critical to boost checkpoint_segments far enough that you are not doing checkpoints oftener than maybe once every five minutes. If the performance problems seem "bursty" then you may also need to look at adjusting bgwriter and/or vacuum cost delay parameters to smooth out the I/O load. regards, tom lane