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 1iEd28-0003jB-VS for pgsql-hackers@arkaria.postgresql.org; Sun, 29 Sep 2019 17:30:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iEd26-0004n9-BB for pgsql-hackers@arkaria.postgresql.org; Sun, 29 Sep 2019 17:30:54 +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 1iEd25-0004j2-P1 for pgsql-hackers@lists.postgresql.org; Sun, 29 Sep 2019 17:30:54 +0000 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iEd1z-0007OJ-9Y for pgsql-hackers@postgresql.org; Sun, 29 Sep 2019 17:30:52 +0000 Received: by mail-qt1-x843.google.com with SMTP id w14so13835076qto.9 for ; Sun, 29 Sep 2019 10:30:47 -0700 (PDT) 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=yRL7MeMqw3cG7RlyKIRZYXickHFywn6ugnyEpd1TWCQ=; b=11s2nU3vOhJ7Q+tsQTS7l9iCm1SwTqWceEdfKDh6/uxnEFqaR4roqf+/02Ws3vI+s3 qa4TfgIcOWedgFah4hPFtb6WPXt+PH/rejXchfyMxmUcdlQArgjT5otVa2FUWDgcyc+W DRdU2eJP4aUCzMnjiaNlpvdoz3b9ja38L6lQ/uUqotJv/pCWsodFFRd3/pAHXfDGxVYL Jf89vzr7CsuNOU7oMAiJmCf2ii4hc6Rprt2KshihveiRtEREB6ElSn5fNIYSoBVdQDJl xYqdUPu5mljkp1reHBo0MQWD1TrcGYdtH9/oQ/Vgs1RcsN0ZjOWzit/pXdIPFVTtmk24 15jA== 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=yRL7MeMqw3cG7RlyKIRZYXickHFywn6ugnyEpd1TWCQ=; b=DzCMB51NdTs8+BOhvDp85LzDsWK9qitZrTV6A9TR8ZGgX77vglEnsDoioE0q3wa98q +eBSce0wrAYY4T/QIeTn5RgMEQe+vF8FvbceteirCMG4m+PRfWwwvMByRKm5lSF5LrCZ FBN2PFP3VwBpsAIAJqOoMd1brwrZM91GXfep4IDVyX0+GLx+Vpem4McLfdvkxu3MOp0l eSPVLF0qhWNI++1niL2bp63/dYwydIzvZjfCvMDbuUlFjzB+W9jR8mQ/IueP+JWqDY8n 3i39/UsMroCFmtFmDLpzMKTdKteQdug7LU7oPVvwUWl+eoGHvWCAbGfiRc0d1SQgIx9n jwEA== X-Gm-Message-State: APjAAAWzAlDQn3yP5jMy9XZ+IJdACvoHrSoGGjvLV9o0ZV6mB9fOjHpL Wk7DBQclkR8wQH/Et1HrGnH7Qg== X-Google-Smtp-Source: APXvYqyXRF66jJ5+2bkHZZKGUbuGJiUMtVGuLS3oTqtV7wQXJ8tiE2K/Nt97n1oZYUI4HRky42T0jQ== X-Received: by 2002:ac8:51:: with SMTP id i17mr21239402qtg.283.1569778246243; Sun, 29 Sep 2019 10:30:46 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([201.186.209.84]) by smtp.gmail.com with ESMTPSA id c16sm4488872qkg.131.2019.09.29.10.30.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Sep 2019 10:30:45 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 1B95E1206EA; Sun, 29 Sep 2019 14:30:44 -0300 (-03) Date: Sun, 29 Sep 2019 14:30:44 -0300 From: Alvaro Herrera To: Amit Kapila Cc: Tomas Vondra , Peter Eisentraut , PostgreSQL Hackers Subject: Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions Message-ID: <20190929173044.GA32051@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.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Sep-29, Amit Kapila wrote: > On Sun, Sep 29, 2019 at 12:39 AM Tomas Vondra wrote: > > So that's what I did in the attached patch - I've renamed the GUC to > > logical_decoding_work_mem, detached it from m_w_m and set the default to > > 64MB (i.e. the same default as m_w_m). > > Fair enough, let's not argue more on this unless someone else wants to > share his opinion. I just read this part of the conversation and I agree that having a separate GUC with its own value independent from other GUCs is a good solution. Tying it to m_w_m seemed reasonable, but it's true that people frequently set m_w_m very high, and it would be undesirable to propagate that value to logical decoding memory usage. I wonder what would constitute good advice on how to set this value, I mean what is the metric that the user needs to be thinking about. Is it the total of memory required to keep all concurrent write transactions in memory? (Quick example: if you do 2048 wTPS and each transaction lasts 1s, and each transaction does 1kB of logically-decoded changes, then ~2MB are sufficient for the average case. Is that correct? I *think* that full-page images do not count, correct? With these things in mind users could go through pg_waldump output and figure out what to set the value to.) -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services