Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eRZ9L-0004pV-Ra for pgsql-performance@arkaria.postgresql.org; Wed, 20 Dec 2017 07:50:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eRZ9L-0002In-Dn for pgsql-performance@arkaria.postgresql.org; Wed, 20 Dec 2017 07:50:47 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eRZ9L-0002Id-2W for pgsql-performance@lists.postgresql.org; Wed, 20 Dec 2017 07:50:47 +0000 Received: from mx2.mailbox.org ([80.241.60.215]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eRZ9D-0002Mr-9l for pgsql-performance@lists.postgresql.org; Wed, 20 Dec 2017 07:50:45 +0000 Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 044404D233; Wed, 20 Dec 2017 08:50:33 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id MiZmEnAGJSFL; Wed, 20 Dec 2017 08:50:23 +0100 (CET) Message-ID: <1513754139.2459.10.camel@cybertec.at> Subject: Re: Autoanalyze CPU usage From: Laurenz Albe To: Habib Nahas , Tomas Vondra Cc: pgsql-performance@lists.postgresql.org In-Reply-To: References: Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Date: Wed, 20 Dec 2017 08:15:39 +0100 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Habib Nahas wrote: > The CPU spike occurred between 13:05 - 13:15. last_autoanalyze for the table > shows a time of 12:49; last_autovacuum does not show any activity around > this time for any table. Checkpoint logs are also normal around this time. > I'd like to understand if there are any other sources of activity I > should be checking for that would account for the spike. last_autoanalyze is set after autoanalyze is done, so that would suggest that autoanalyze is not the problem. It can be tough to figure out where the activity is coming from unless cou can catch it in the act. You could log all statements (though the amount of log may be prohibitive and can cripple performance), you could log just long running statements in the hope that these are at fault, you could log connections and disconnections and hope to find the problem that way. Maybe logging your applications can help too. Yours, Laurenz Albe