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 1nZvdy-0000T7-5s for pgsql-performance@arkaria.postgresql.org; Thu, 31 Mar 2022 14:19:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nZvdw-0003v6-QN for pgsql-performance@arkaria.postgresql.org; Thu, 31 Mar 2022 14:19:20 +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 1nZvdw-0003uw-GZ for pgsql-performance@lists.postgresql.org; Thu, 31 Mar 2022 14:19:20 +0000 Received: from mail.mnc.ch ([62.2.77.205]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nZvdt-0003pC-NR for pgsql-performance@lists.postgresql.org; Thu, 31 Mar 2022 14:19:19 +0000 X-Virus-Scanned: amavisd-new at mnc.ch Sender: gc@mnc.ch Received: by gc-P7xxDM3-G.localdomain (Postfix, from userid 1000) id 4762389374; Thu, 31 Mar 2022 16:18:37 +0200 (CEST) From: Guillaume Cottenceau To: pgsql-performance@lists.postgresql.org Subject: Re: Postgresql TPS Bottleneck References: Date: Thu, 31 Mar 2022 16:18:37 +0200 In-Reply-To: (wakandavision@outlook.com's message of "Thu, 31 Mar 2022 11:50:34 +0000") Message-ID: <87zgl64342.fsf@mnc.ch> MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk writes: > Optimally I would like to fully use the CPU and get about 3-4 times > more TPS (if even possible). Disclaimer: I'm really not a pg performance expert. I don't understand your hope to fully use the CPU; if your scenario is disk-limited, which may very well be the case, then of course you cannot fully use the CPU. With synchronous commits and fsync, the system is probably spending time just waiting for the disks to report the writes completion. Are iostat/vmstat showing a lot of IO-wait? Also, if you can live with a few lost transactions in case of server crash, synchronous_commit=off is very ok and provides a lot of performance gain. -- Guillaume Cottenceau