Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TG94i-0002Fl-JG for pgsql-performance@postgresql.org; Mon, 24 Sep 2012 13:51:52 +0000 Received: from mail-wi0-f172.google.com ([209.85.212.172]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TG94g-0003Wp-DP for pgsql-performance@postgresql.org; Mon, 24 Sep 2012 13:51:51 +0000 Received: by wibhq12 with SMTP id hq12so1911359wib.1 for ; Mon, 24 Sep 2012 06:51:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=bvF5BpI4BiiYcnkuCmCz0opkjQtbMKQ0YbJl3xtII6Y=; b=aKd8JyOWbMlkt2c8I5dtQZFGbIjTGlPjNPVTdwV0TeI1Mlisp/eWzf1eLYqe8IM0v3 Hq7n6A4mSPbhNkKX8HZ7OYXWlmcuAthCfIFz5nARBUn6xZ/LZA3md1wrtPRj40yjcrWn wtUbZsC+Ikgviu8CtPs+B9jj+obRHwMFBRX+0gHo3CiLUCfLpxAwhMtcDun9qbYhJ6p+ mA33uxT1FEuewIQUM5ZhgFwxtHBrjqN3gV+KRg8rBZQdgOkK0lIkd3nhmIY1ppGbWYlM KjOAxslqWn1lDCiYBQyTVqyCJ3SGq/T/mije6Ntj1GTxQacVGdFaq908x/qQtIWY1Ww1 i2cA== Received: by 10.180.102.136 with SMTP id fo8mr14549342wib.19.1348494708700; Mon, 24 Sep 2012 06:51:48 -0700 (PDT) Received: from [192.168.1.103] (kstr60.static.otenet.gr. [79.129.45.250]) by mx.google.com with ESMTPS id f10sm11844960wiy.9.2012.09.24.06.51.46 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 24 Sep 2012 06:51:47 -0700 (PDT) Subject: Re: Postgres becoming slow, only full vacuum fixes it Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=iso-8859-1 From: Kiriakos Tsourapas In-Reply-To: <50605035.8020107@ulb.ac.be> Date: Mon, 24 Sep 2012 16:51:44 +0300 Cc: pgsql-performance@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <3A53BCFC-561D-4C75-96D8-5DB3DCC4DC93@gmail.com> References: <71DC95CE-16EF-4D53-9971-C573DCD30622@gmail.com> <50605035.8020107@ulb.ac.be> To: Julien Cigar X-Mailer: Apple Mail (2.1278) X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201209/110 X-Sequence-Number: 47856 Hi, Thank you for your response. Please find below my answers/comments. On Sep 24, 2012, at 15:21, Julien Cigar wrote: > Hello, >=20 > 1) upgrade your PostgreSQL installation, there have been numerous = bugfixes releases since 8.4.2 Not possible right now. It will have to be the last solution. > 2) you'll have to show us an explain analyze of the slow queries. If I = take a look at those you provided everything run i less than 1ms. Will do so in a couple of days that it will get slow again. > 3) with 200 records you'll always have a seqscan Does it really matter? I mean, with 200 records any query should be = ultra fast. Right ? > 4) how much memory do you have ? shared_buffers =3D 256MB and = effective_cache_size =3D 512MB looks OK only if you have between 1 and = 2GB of RAM I have included the server specs and the results of top commands, = showing that we have 8GB ram and how much memory is used/cached/swapped. = Personally I don't quite understand the linux memory, but I have posted = them hoping you may see something I don't. > 5) synchronous_commit =3D off should only be used if you have a = battery-backed write cache. I agree with the comments that have followed my post. I have changed it, = knowing there is a small risk, but hoping it will help our performance. > 6) autovacuum_naptime should be changed only if autovacuum is = constantly running (so if you have dozen of databases in your cluster) As I said, changing the autovacuum values have not changed the problem. = So, you may as well consider that we have the default values for = autovacuuming... the problem existed with the default values too. > 7) are you sure the problem isn't related to Bucardo ? Not at all sure... I have no idea. Can you suggest of a way to figure it = out ? Thank you=