Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TIxlu-0000b7-VM for pgsql-performance@postgresql.org; Tue, 02 Oct 2012 08:24:07 +0000 Received: from smtp-outbound-2.vmware.com ([208.91.2.13]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TIxlr-0006cP-Vn for pgsql-performance@postgresql.org; Tue, 02 Oct 2012 08:24:06 +0000 Received: from sc9-mailhost2.vmware.com (sc9-mailhost2.vmware.com [10.113.161.72]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 56F2728294; Tue, 2 Oct 2012 01:24:01 -0700 (PDT) Received: from zimbra-prod-ext-mta-1.vmware.com (zimbra-prod-ext-mta-1.vmware.com [10.113.62.211]) by sc9-mailhost2.vmware.com (Postfix) with ESMTP id 50034B03AF; Tue, 2 Oct 2012 01:24:01 -0700 (PDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by zimbra-prod-ext-mta-1.vmware.com (Postfix) with ESMTP id 3DEB2E0035; Tue, 2 Oct 2012 01:24:01 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra-prod-ext-mta-1.vmware.com Received: from zimbra-prod-ext-mta-1.vmware.com ([127.0.0.1]) by localhost (zimbra-prod-ext-mta-1.vmware.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id M4ICOnhtdOMz; Tue, 2 Oct 2012 01:24:01 -0700 (PDT) Received: from [192.168.1.105] (unknown [10.113.62.14]) by zimbra-prod-ext-mta-1.vmware.com (Postfix) with ESMTPSA id EE48BE0034; Tue, 2 Oct 2012 01:11:42 -0700 (PDT) Message-ID: <506AA1BC.1070305@vmware.com> Date: Tue, 02 Oct 2012 11:11:40 +0300 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.6esrpre) Gecko/20120817 Icedove/10.0.6 MIME-Version: 1.0 To: pg noob CC: pgsql-performance@postgresql.org Subject: Re: deadlock_timeout affect on performance References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -9.0 (---------) X-Archive-Number: 201210/10 X-Sequence-Number: 47969 On 01.10.2012 19:49, pg noob wrote: > Hi all, > > I have a question about the deadlock_timeout in regards to performance. > Right now we have this timeout set at its default of 1s. > My understanding of it is that this means that every 1 second the server > will check for deadlocks. Not quite. It means that when a backend gets blocked, waiting on a lock, it will check for deadlocks after waiting for 1 second. When no backend is waiting for a lock, there are no deadlock checks regardless of deadlock_timeout. > What I am wondering is how much of a performance improvement we would > expect to get if this was raised to 30 seconds? > Is it negligible or could it be a substantial performance improvement on a > busy system? > We very rarely have deadlocks and waiting 30 seconds to discover one > doesn't seem too bad. It's almost certainly negligible. If you regularly have deadlocks, it might even better for performance to make the timeout shorter than 1 s, so that deadlocks are detected earlier, and backends will spend less time deadlocked, and more time doing real work. Although I doubt it will make any meaningful difference either way. - Heikki