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 1nTnfn-0002B1-5R for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Mar 2022 16:35:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nTnfl-0005cn-S9 for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Mar 2022 16:35:53 +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 1nTnfl-0005ce-Fy for pgsql-hackers@lists.postgresql.org; Mon, 14 Mar 2022 16:35:53 +0000 Received: from mail-qt1-x829.google.com ([2607:f8b0:4864:20::829]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nTnfi-0002ob-81 for pgsql-hackers@postgresql.org; Mon, 14 Mar 2022 16:35:52 +0000 Received: by mail-qt1-x829.google.com with SMTP id i8so1687064qtx.6 for ; Mon, 14 Mar 2022 09:35:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=fV8i5sbSxjhPWiZM0SrETR9koHdanHCkMSxX0yIA1dQ=; b=tqll7mTr3F2VkDM2AxLJkuITD2bfHTi+xd5Ocgm3Kg6GpGBfIAhfTafQboT2mLRXFz 80l3XFTTXqdJoVUzYITyUsGrh7rV2ug/oxW5li5ytF4It2OLkdfmAzgcDb/iuhoTe5Ll wYnOaI97Avz/DDa+cLskIUnkeq73Mmq00cQmKmpwRx61R5sGvLYowL0sHB3iu7fok2tx csb7OKafk3CiEgiSRYTVaUQIg48X4sCD2p9+k8bIi6o1v0ZxO2jJUbT+URKZnLDmMujE nueChhV3xTMibBKJKvnjsyBbLKjgf67JqXREAcNByMDjwLu5XYlbZIuRbBSPxpZSmzoD TwFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=fV8i5sbSxjhPWiZM0SrETR9koHdanHCkMSxX0yIA1dQ=; b=0QKch0A/cFBKfcNqfxZeTjG9YgJuro3kymWKiXmDJysl89xtJ9UmmaC6GT9gJKEZrL rsfIAsxsZF7HxyOMwGopQO0jTOtD7bA1nMwuQ/Vbcg8TT3vMobkrlD0965N4CV/ud+22 Ll6v2jVHy4Ze2LKAJwC1k9YWiRhfl/yCFoFK/BfGI6hmGALzQO21MNZuXR/cAJyYrGd0 0Ee1GAgCMrapgDl+0+QtA/bv0wANp7D7teAlugFWCAskwgC+zTjN8qe9Vpv6xJ8vLJKN kDtrG7T5oB5v5yjbIxY3fTZSbB+eskNp8iNqaR14AV7Q3hoJyLzbkebXCvjd9QiWAMWc 7eHw== X-Gm-Message-State: AOAM530G1wdvi8jaXzTez+G8xYC8uYtsk1KntpRh5iWBedK2gnsmSkf8 C9vP55aVPUZzvc1uiLgE3orgRg== X-Google-Smtp-Source: ABdhPJwdOo1Ge0Rl6b78FnC/y32Ga55RFFdAhuB3OI/8YWRDvfdj4JVG0DVUrWiNshBSws0rAEgz4A== X-Received: by 2002:ac8:5dcb:0:b0:2e1:ce48:c186 with SMTP id e11-20020ac85dcb000000b002e1ce48c186mr5966308qtx.2.1647275749011; Mon, 14 Mar 2022 09:35:49 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id 193-20020a3706ca000000b0067d3e4b5667sm7783898qkg.67.2022.03.14.09.35.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Mar 2022 09:35:48 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 458CB8007D0; Mon, 14 Mar 2022 11:35:47 -0500 (CDT) Date: Mon, 14 Mar 2022 11:35:47 -0500 From: Justin Pryzby To: Dipesh Pandit Cc: Robert Haas , Andres Freund , Jeevan Ladhe , Alvaro Herrera , "Shinoda, Noriyoshi (PN Japan FSIP)" , Abhijit Menon-Sen , Dmitry Dolgov <9erthalion6@gmail.com>, Jeevan Ladhe , Mark Dilger , pgsql-hackers@postgresql.org, tushar Subject: Re: refactoring basebackup.c (zstd workers) Message-ID: <20220314163547.GT28503@telsasoft.com> References: <20220311010223.GI28503@telsasoft.com> <20220312015253.zokhkwdn5xbbd4vf@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Mar 14, 2022 at 09:41:35PM +0530, Dipesh Pandit wrote: > I tried to implement support for parallel ZSTD compression. The > library provides an option (ZSTD_c_nbWorkers) to specify the > number of compression workers. The number of parallel > workers can be set as part of compression parameter and if this > option is specified then the library performs parallel compression > based on the specified number of workers. > > User can specify the number of parallel worker as part of > --compress option by appending an integer value after at sign (@). > (-Z, --compress=[{client|server}-]{gzip|lz4|zstd}[:LEVEL][@WORKERS]) I suggest to use a syntax that's more general than that, maybe something like :[level=]N,parallel=N,flag,flag,... For example, someone may want to use zstd "long" mode or (when it's released) rsyncable mode, or specify fine-grained compression parameters (strategy, windowLog, hashLog, etc). I hope the same syntax will be shared with wal_compression and pg_dump. And libpq, if that patch progresses. BTW, I think this may be better left for PG16. -- Justin