Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j4RCl-0000K7-Go for pgsql-performance@arkaria.postgresql.org; Wed, 19 Feb 2020 15:24:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j4RCk-0001iA-3f for pgsql-performance@arkaria.postgresql.org; Wed, 19 Feb 2020 15:24:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j4RCj-0001hy-Me for pgsql-performance@lists.postgresql.org; Wed, 19 Feb 2020 15:24:01 +0000 Received: from mail-yw1-xc44.google.com ([2607:f8b0:4864:20::c44]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j4RCg-0004Xw-BI for pgsql-performance@lists.postgresql.org; Wed, 19 Feb 2020 15:24:00 +0000 Received: by mail-yw1-xc44.google.com with SMTP id z141so240554ywd.13 for ; Wed, 19 Feb 2020 07:23:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=cpHZ/xtUqP16de/NOVd8OCvSFIZ445R16VUq5dugPfM=; b=p+hfLi8YD2r5XwlL40TJ+k2WdHZvigH6ZX8PSnOqzN61LtHC9aqrsjnJdoaDAGv/SB cYwsZBT0t/xNo3lE2XX8LF4qRXj6ifRESDJytDQWPj4fAwAp6JjJ24kCfeJEO/AL8b4p wfA87A+O2Aym0mHKo1R5/yfzz+pHWQGs6FhELAmtQZSm9TFhgV0sd3NxBqNmXbyXbgTo pJdeXWgX7roJShAQAO3o5BnakccPJA+x7YO2EHt9rrqDb8/ebfu0mOwPUdDF1GVcxWF/ HPthvCB8QUtHetoHsz4Dfuvcye3BG+IE9yLB2cNNjxxO4+Arri9pO2TOijU9PSHYWcbx 85kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=cpHZ/xtUqP16de/NOVd8OCvSFIZ445R16VUq5dugPfM=; b=rn2cKy7PVg0ovodhBM20WeiAIEn66PLPsUwuRUmKHU/W/QwQ6gjUtZOvF4qgxlVeuV XJzKsypIRxXnGQkwFm6Ol1oF4L9hhwyfZCa99gNCQTrXLb/fzykGc5cB+FwmASJf1M9x M4z7uev7H6EKZlis5HGgVzS6Fjl1D75004ulvTF0VYYuoiZtabHfCTIUJvCL4bqIVkXb k3DRSsgpj4hQBZ51N9DUH0myjxmOe8C/NH6/KnYuRMB38BU0aclkBLpdjtyxT1XwCJ+F D0T8aOV1qtNg6EmMYdoqAAeGWnEi60u2JP2DMa/rojgKzltBuU+FZwPaCllJX3oyChh0 PlSw== X-Gm-Message-State: APjAAAUZ17J6HSkLLkfy+MMrMW63QYCj2OiAK9QEjNdDEOgTDQyMMeQR pKjfyD36rKgiB6APb7cHmlGJyw== X-Google-Smtp-Source: APXvYqzbUjY9IMOgpAEq66ajK9VNQomMVMl70XTSL60jIJotK+Xfp0xiSWwRC9+7h9Hga32IohzWMA== X-Received: by 2002:a81:72c2:: with SMTP id n185mr20665484ywc.286.1582125837474; Wed, 19 Feb 2020 07:23:57 -0800 (PST) Received: from nimloth.alvh.no-ip.org ([199.116.115.138]) by smtp.gmail.com with ESMTPSA id p204sm100129ywp.14.2020.02.19.07.23.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2020 07:23:56 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 40A293006B6; Wed, 19 Feb 2020 12:23:53 -0300 (-03) Date: Wed, 19 Feb 2020 12:23:53 -0300 From: Alvaro Herrera To: Lars Aksel Opsahl Cc: Laurenz Albe , Pavel Stehule , Tom Lane , "pgsql-performance@lists.postgresql.org" Subject: Re: SubtransControlLock and performance problems Message-ID: <20200219152353.GA2663@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Feb-19, Lars Aksel Opsahl wrote: > With the values above I did see same performance problems and we ended > with a lot of subtransControlLock. > > So I started to change the code based on your feedbacks. > > - What seems to work very good in combination with a catch exception > and retry pattern is to insert the data in to separate table for each > job. (I the current testcase we reduced the number of > subtransControlLock from many hundreds to almost none.) I think at this point your only recourse is to start taking profiles to see where the time is going. Without that, you're just flying blind and whatever you do will not necessarily move your needle at all. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services