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 1ozrTO-0006l7-K1 for pgsql-performance@arkaria.postgresql.org; Tue, 29 Nov 2022 03:39:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ozrTN-000712-F6 for pgsql-performance@arkaria.postgresql.org; Tue, 29 Nov 2022 03:39:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ozrTN-00070t-29 for pgsql-performance@lists.postgresql.org; Tue, 29 Nov 2022 03:39:53 +0000 Received: from mail-qk1-x729.google.com ([2607:f8b0:4864:20::729]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ozrTK-0004P3-H4 for pgsql-performance@lists.postgresql.org; Tue, 29 Nov 2022 03:39:52 +0000 Received: by mail-qk1-x729.google.com with SMTP id z17so8866624qki.11 for ; Mon, 28 Nov 2022 19:39:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=0tmJzF5OBwTFS/V0GNYuXNa/WsZtVFPXq6pGXZtdrNw=; b=mK0Flpu2kWM0hSW6QrnkBw9KtHy0Qsmrz7gvE4sncyqwSNpO8AmvTY6Sz9o9CwVJlf gq6nz9CnEPqVq7OjCtSamIZlgzoyBKh1+rzCBzuha8JRF2iXPVjN93c7PlkzpogcFvs+ n+qXafMc/0qf5lKpda25TLcug3GZzjbooE4RX3xVS9hb56okh7TxhSpqgcXKiGddx354 2NeX9xUOUjrI+5aiK18ER2tRvHizpUHh9dcpwFx+rFD8ig3zSdBVfy4IRKt7sfr7YCk2 2x0/5jX2Gg9DB+eLQ+IPRgr1YywH04A5dEgV5v+vlCh7lZUas/Oj2l8l4ZeTJkGPeeMe JqQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=0tmJzF5OBwTFS/V0GNYuXNa/WsZtVFPXq6pGXZtdrNw=; b=xe5/uiSRSBcbBaGruwkOPd1jPqsS0yGr4Lf3PgCQ41Hwk4eN4RdzfAIl4ajSrGeDDo VpLaKOgplP8Xne0gdLITPufuPTHT7J0Nc1eYYy1QKQ6X+Hs+KQVAM1wBjYFKxrflWGkY tFcUEj8Qb8owepuD3pL0oXmjlMQTonfXnbcgOZe2lU2A6p2DXG1sm+8+DuNVJfa4nRxD ImkKlymVUfr/OENHg7BLHGlEcbRmpV1YCMN4wYMpoxVQqRgpHFaFb+2k2Ao+nyzdNzQi WrepF7MOUNdP1edCyN7xZQhqDHxuet1B9gzYPnEg5CBNlCRj4PTHksi0CMccyn+omYSD TZKA== X-Gm-Message-State: ANoB5pnblFuU0Ew3E+4sUZuXgb5BtxwyjWyZQzWgYu8gRetWpzrockDV Eu5pdWYhVYFbFH19BXiIfrtlhocj6HU+ew== X-Google-Smtp-Source: AA0mqf68PZbE2YLRKC3+O9p52k2/oTpFkUBb4fLUH2uB6f9Z2oCYlKnmV6u8dx6Sg49atCZjJZPfHw== X-Received: by 2002:a05:620a:899:b0:6f9:b775:474a with SMTP id b25-20020a05620a089900b006f9b775474amr38789648qka.405.1669693188715; Mon, 28 Nov 2022 19:39:48 -0800 (PST) Received: from [192.168.2.100] (pool-72-79-30-4.nwrknj.east.verizon.net. [72.79.30.4]) by smtp.gmail.com with ESMTPSA id dm32-20020a05620a1d6000b006e702033b15sm9533397qkb.66.2022.11.28.19.39.48 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Nov 2022 19:39:48 -0800 (PST) Content-Type: multipart/alternative; boundary="------------QmLvaXL8v8suWbJkmBTUseFH" Message-ID: <7dff29ee-de7c-00b6-4efb-064b9df1c871@gmail.com> Date: Mon, 28 Nov 2022 22:39:47 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: Catching up with performance & PostgreSQL 15 Content-Language: en-US To: pgsql-performance@lists.postgresql.org References: <89e7da59-0dfe-45fe-e082-00f777e200a1@berkus.org> From: Mladen Gogala In-Reply-To: <89e7da59-0dfe-45fe-e082-00f777e200a1@berkus.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------QmLvaXL8v8suWbJkmBTUseFH Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 11/28/22 21:59, Josh Berkus wrote: > Hey, folks: > > I haven't configured a PostgreSQL server since version 11 (before > that, I did quite a few). > > What's changed in terms of performance configuration since then? Have > the fundamentals of shared_buffers/work_mem/max_connections changed at > all?  Which new settings are must-tunes? > > I've heard about new parallel stuff an JIT, but neither is that > applicable to my use-case. > Well, well! Long time no see! You'll probably be glad to learn that we have hints now. Thank you for the following page you created: https://laptrinhx.com/why-postgresql-doesn-t-have-query-hints-2912445911/ I've used it several times, with great success. It's priceless. Now, to answer your question: no, fundamentals of shared buffers, work memory and connections haven't changed. Parallelism works fine, it's reliable and easy to enable. All you need is to set max_parallel_workers_per_gather to an integer > 0 and PgSQL 15 will automatically use parallel plan if the planner decides that it's the best path. However, to warn you in advance, parallel query is not a panacea. On OLTP databases, I usually disable it on purpose. Parallel query will speed up sequential scans, but if your application is OLTP, sequential scan is a sign of trouble. Parallelism is a data warehouse only feature. And even then, you don't want it ti be run by multiple users at the same time. Namely, the number of your CPU resources is finite and having multiple users launch multiple processes is the best way to run out of the CPU power fast. Normally, you would package an output of the parallel query into a materialized view and let the users query the view. As for JIT, I've recently asked that question myself. I was told that PostgreSQL with LLVM enabled performs approximately 25% better than without it. I haven't measured it so I can't  either confirm or deny the number.  I can tell you that there is a noticeable throughput improvement with PL/PGSQL intensive applications. There was also an increase in CPU consumption. I wasn't doing benchmarks, I was looking for a generic settings to install via Ansible so I don't have the numbers, only the feeling. One way of quantifying the difference would be to run pgbench with and without JIT. PS: I am still an Oracle DBA, just as you wrote in the paper. -- Mladen Gogala Database Consultant Tel: (347) 321-1217 https://dbwhisperer.wordpress.com --------------QmLvaXL8v8suWbJkmBTUseFH Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 11/28/22 21:59, Josh Berkus wrote:
Hey, folks:

I haven't configured a PostgreSQL server since version 11 (before that, I did quite a few).

What's changed in terms of performance configuration since then?  Have the fundamentals of shared_buffers/work_mem/max_connections changed at all?  Which new settings are must-tunes?

I've heard about new parallel stuff an JIT, but neither is that applicable to my use-case.

Well, well! Long time no see! You'll probably be glad to learn that we have hints now. Thank you for the following page you created:

https://laptrinhx.com/why-postgresql-doesn-t-have-query-hints-2912445911/

I've used it several times, with great success. It's priceless.

Now, to answer your question: no, fundamentals of shared buffers, work memory and connections haven't changed. Parallelism works fine, it's reliable and easy to enable. All you need is to set max_parallel_workers_per_gather to an integer > 0 and PgSQL 15 will automatically use parallel plan if the planner decides that it's the best path. However, to warn you in advance, parallel query is not a panacea. On OLTP databases, I usually disable it on purpose. Parallel query will speed up sequential scans, but if your application is OLTP, sequential scan is a sign of trouble. Parallelism is a data warehouse only feature. And even then, you don't want it ti be run by multiple users at the same time. Namely, the number of your CPU resources is finite and having multiple users launch multiple processes is the best way to run out of the CPU power fast. Normally, you would package an output of the parallel query into a materialized view and let the users query the view.

As for JIT, I've recently asked that question myself. I was told that PostgreSQL with LLVM enabled performs approximately 25% better than without it. I haven't measured it so I can't  either confirm or deny the number.  I can tell you that there is a noticeable throughput improvement with PL/PGSQL intensive applications. There was also an increase in CPU consumption. I wasn't doing benchmarks, I was looking for a generic settings to install via Ansible so I don't have the numbers, only the feeling. One way of quantifying the difference would be to run pgbench with and without JIT.

PS:

I am still an Oracle DBA, just as you wrote in the paper.

-- 
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com
--------------QmLvaXL8v8suWbJkmBTUseFH--