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 1j3lmY-0004WU-2b for pgsql-performance@arkaria.postgresql.org; Mon, 17 Feb 2020 19:10:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j3lmW-0001FC-5G for pgsql-performance@arkaria.postgresql.org; Mon, 17 Feb 2020 19:10:12 +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 1j3lmV-0001Er-Lx for pgsql-performance@lists.postgresql.org; Mon, 17 Feb 2020 19:10:11 +0000 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j3lmT-0000Ik-23 for pgsql-performance@lists.postgresql.org; Mon, 17 Feb 2020 19:10:10 +0000 Received: by mail-qk1-x744.google.com with SMTP id o28so15859774qkj.9 for ; Mon, 17 Feb 2020 11:10:08 -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=FR/nxx2iRNmWyBCCAk+Fz9OYPA6rj9Mc2MQvTRtNG+0=; b=u5btP+YR7APP4mboLeNbUSWD23hu4J/al0zlWrsfwAiUYVf8SuRt+BoYVJ6QB7ebop V+Q1x/1XOJ3gCEVwjZIhyier/bMQc2JprswLEqLtvDLk4FHtf2NSNxIWnML10qBafO7K mxcyqL7oUwHJDhTnDhNAz+8ydRzBISkFEBFL0RNs+ucebMcMybT5Uy3TN3YPoYf9l8Go nzvacXHmZrRkTVH2549F0jRInj3X1xvM3Dl9Z88pkYwlmNxhlx1l+KeVbSg9QHqbYkQO +OqKh4/F5zOzJ1HwimxrvmhxNXswwtNqo2fe4G8OUblVLTJHcdbi0q4Mz1BY0oaYe19r 94Fw== 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=FR/nxx2iRNmWyBCCAk+Fz9OYPA6rj9Mc2MQvTRtNG+0=; b=a4AlJIC3HFolbaApmBMJzbsP9zz8OEfC3+COd6mt7MqkS1S08uxqR5f91bj5hmnaqK rj1AITcDS/rz2ZFQ/LtS68kyHc/1FGeT0PWo5cnt5jpWmKYp9qpbzKk8XAoDYGu2pu4z Q7vcM5tnrkbIqszUrkX2s8GNUt/7Nyv2vUzlU9a/Wpbiq7GXe7GFcXEGsuoI1bx40Jq0 sKgbKlhDkjxKqnveinuRcD6qF7Htopa4cquAQJd3XJ/JEqC+Y04UGx9WDJtCrLX8tIcu 0nGR2tkfrCuByNUPfRTdDzNPEgoG1n0IWIKW1+C4Mx55PgzqwzmRs3Xd/Pq0WfoQmrD4 tLHw== X-Gm-Message-State: APjAAAU6IhtWZZDnIQLCrZtfqpnM4rSITavfjoiZRq8iAPEtPD2CbSNa GNBSEdfi5xqK0yIZiLC5BmYaxsZP3zY0LPsql2JhimYsZ07m84ASVfDTWxR6er7FKq2usJTgwKd ARVN1XLxRvY2rR388OFVsueM7QnVWyhRZ2cPT+pITGRBUaxMSCS74JGYqXR0x9liMp1jFVOu6cE qDoHAL4S08hpRAtUvRPlc= X-Google-Smtp-Source: APXvYqx2WZ4RtuZ4ED2Pd/2O9LyO2WM6Z649aFKLduhmXlaYmysMxMWxdk6131PZAECw7Ck53zKDOQ== X-Received: by 2002:a37:47c8:: with SMTP id u191mr16005360qka.438.1581966607843; Mon, 17 Feb 2020 11:10:07 -0800 (PST) Received: from nimloth.alvh.no-ip.org ([201.186.208.119]) by smtp.gmail.com with ESMTPSA id k62sm657021qkc.95.2020.02.17.11.10.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2020 11:10:07 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 89F4A300760; Mon, 17 Feb 2020 16:10:05 -0300 (-03) Date: Mon, 17 Feb 2020 16:10:05 -0300 From: Alvaro Herrera To: Lars Aksel Opsahl Cc: "pgsql-performance@lists.postgresql.org" Subject: Re: SubtransControlLock and performance problems Message-ID: <20200217191005.GA20055@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-16, Lars Aksel Opsahl wrote: > On a server with 32 cores and 250 GB memory, with CentOS 7 and kernel > 4.4.214-1.el7.elrepo.x86_64, I try to run 30 parallel threads using > dblink. (https://github.com/larsop/postgres_execute_parallel) . I have > tried to disconnect and reconnect in the dblink code and that did not > help. I think one issue is that pg_clog has 128 buffers (per commit 5364b357fb1) while subtrans only has 32. It might be productive to raise the number of subtrans buffers (see #define NUM_SUBTRANS_BUFFERS in src/include/access/subtrans.h; requires a recompile.) Considering that each subtrans entry is 16 times larger than clog (2 bits vs. 4 bytes), you'd require 2048 subtrans buffers to cover the same XID range without I/O if my math is right. That's only 16 MB ... though slru.c code might not be prepared to deal with that many buffers. Worth some experimentation, I guess. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services