Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jiHyz-0002iO-V9 for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Jun 2020 13:38:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jiHyy-0002al-0m for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Jun 2020 13:38:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jiHyx-0002ae-Lj for pgsql-hackers@lists.postgresql.org; Mon, 08 Jun 2020 13:38:31 +0000 Received: from mail-ej1-x643.google.com ([2a00:1450:4864:20::643]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jiHyv-0001iH-4A for pgsql-hackers@postgresql.org; Mon, 08 Jun 2020 13:38:30 +0000 Received: by mail-ej1-x643.google.com with SMTP id e2so18299938eje.13 for ; Mon, 08 Jun 2020 06:38:28 -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:references:mime-version :content-disposition:in-reply-to; bh=K85NAaH8GXruFiwCFWuwvXDT+SZd+f+CGkl6+JKRLDQ=; b=KZ4ANTIzn6GWwyrEMGRim9WUanrmFz4v/3FQrKSk0h6GgPLjmvF1QtWM2fqCIgLqbc OpxX5wJS1PsBu1o8lm4DcqrOkxBwM8mIErweHu+JejtLrbvXX56W10NKDNVLofncJwjh SboZM+i8oSCphv70GE5OQszxLC6OXRCinbGJCXSlKGMyVHrinfdJ/souLcKPhafzEm1C b62WhtEH9yFA9fgm0QywUpF3Ydrj4FlooX/ngHvFMjHE8yRNtmZhWFec1QfrHKlNG0XR VP0qf2ChPhPJsNDcNmUtYh4Zru9YfBX1O9vM4fE7sP0v6jnKzzbXLIhmKfhLbVxno+oP y/sQ== 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:references :mime-version:content-disposition:in-reply-to; bh=K85NAaH8GXruFiwCFWuwvXDT+SZd+f+CGkl6+JKRLDQ=; b=guWoMCkKNbp/Z2NJXF0KKC3VpZsqcVWbbCUPfp/omDc4bPDNSVgRWbq1J3NCA7j+4m OIX4dsbi8vlPRvAUCu3otydYV2r01NeseK8+GfbLIYfFdaqleOci3va6MgvHG+D3F+ZP zuEA8fPUW7xbMeFxQuHS2t67R5OQd6/ICJfM2Uq+yI9RxU0m7O6Sswiyh0l2dHBZ3GNJ IBVpkSDbtktSeMND9fCE7apKH3LZ+fPaBSLIiZ+tOvJkkGPVmVDbgCQOWX39bDNgh6gw nuRi5AZoiFPjT0Par0jHN6JnAgMUI0cG6+UrJBRDoRM4fs13qv8gYGIrRwbqlp5xXtRI dsBg== X-Gm-Message-State: AOAM5321OF98nK2wYcptclSeeOsofAnLaHrR5hT26ziFLuqW1G/Y2ZBB xv1BmG/7Z6SojLr38T4yKsYOZQ== X-Google-Smtp-Source: ABdhPJwWsfOyU8sDtbO2clPzTLuCquvBIJ8m6HjVRWruxvvbVWorrjXVlDriZsVk2CXx6AsTZCX3Vw== X-Received: by 2002:a17:906:51d1:: with SMTP id v17mr10005153ejk.383.1591623507674; Mon, 08 Jun 2020 06:38:27 -0700 (PDT) Received: from localhost (static-84-42-175-93.net.upcbroadband.cz. [84.42.175.93]) by smtp.gmail.com with ESMTPSA id r6sm11891319edq.44.2020.06.08.06.38.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jun 2020 06:38:26 -0700 (PDT) Date: Mon, 8 Jun 2020 15:38:24 +0200 From: Tomas Vondra To: Magnus Hagander Cc: Michael Paquier , Amit Kapila , David Fetter , PostgreSQL Development Subject: Re: Bump default wal_level to logical Message-ID: <20200608133824.57lwoctf7gapnkmr@development> References: <20200608043833.GX13741@fetter.org> <20200608064555.GE2589@paquier.xyz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, Jun 08, 2020 at 11:10:38AM +0200, Magnus Hagander wrote: >On Mon, Jun 8, 2020 at 8:46 AM Michael Paquier wrote: > >> On Mon, Jun 08, 2020 at 11:59:14AM +0530, Amit Kapila wrote: >> > I think we should first do performance testing to see what is the >> > overhead of making this default. I think pgbench read-write at >> > various scale factors would be a good starting point. Also, we should >> > see how much additional WAL it generates as compared to current >> > default. >> >> +1. I recall that changing wal_level to logical has been discussed in >> the past and performance was the actual take to debate on. >> > >That was at least the discussion (long-going and multi-repeated) before we >upped it from minimal to replica. There were some pretty extensive >benchmarking done to prove that the difference was very small, and this was >weighed against the ability to take basic backups of the system (which >arguably is more important than being able to do logical replication). > >I agree that we should consider changing it *if* it does not come with a >substantial overhead, but that has to be shown. > I agree performance evaluation is necessary, and I'm willing to spend some time on it. But I don't think the difference will be much worse than for the wal_level=replica, at least for common workloads. It's certainly possible to construct workloads with significant impact, due to the extra stuff (assignments, cache invalidations and so on). In general I think the case is somewhat weaker compared to the replica case, which was required for such basic things like physical backups. >Of course, what would be even neater would be if it could be changed so >you don't have to bounce the server to change the wal_level. That's a >bigger change though, but perhaps it is now possible once we have the >"global barriers" in 13? > Yeah. That would sidestep a lot of the performance concerns, because if switching from replica to logical is fairly easy / without restart, we could keep the current default. Not sure if it's sufficient, though, because switching to logical may require bumping up number of slots, walsenders, etc. At which point you actually need a restart. Not to mention that extensions using logical decoding (like pglogical) need to allocate shared memory etc. But for the built-in logical replication that is not an issue, ofc. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services