Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZCbMJ-0002Il-Hp for pgsql-bugs@arkaria.postgresql.org; Tue, 07 Jul 2015 22:28:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZCbMI-0001zn-2L for pgsql-bugs@arkaria.postgresql.org; Tue, 07 Jul 2015 22:28:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZCbLT-0001K5-AS for pgsql-bugs@postgresql.org; Tue, 07 Jul 2015 22:28:07 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZCbLP-0004er-HF for pgsql-bugs@postgresql.org; Tue, 07 Jul 2015 22:28:06 +0000 MIME-Version: 1.0 Subject: BUG #13493: pl/pgsql doesn't scale with cpus (PG9.3, 9.4) To: pgsql-bugs@postgresql.org From: grb@skogoglandskap.no Date: Tue, 07 Jul 2015 22:27:39 +0000 Message-ID: <20150707222739.1188.8068@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.9 (-) Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 13493 Logged by: Graeme Bell Email address: grb@skogoglandskap.no PostgreSQL version: 9.3.9 Operating system: Linux Description: Hi, pl/pgsql doesn't scale properly on postgres 9.3/9.4 with multiple processors beyond 2-3 processors for me, regardless of the machine I use or the benchmark/project. I discovered this painfully during a project here where we were running a small 'forest simulator' in pl/pgsql on different datasets simultaneously. To highlight the problem, I've provided a benchmark that demonstrates two problems (on my machines). 1. The first problem is scaling when you have lots of pl/pgsql code running and doing real work. 2. The second problem is scaling when you have a table column as an input parameter. The benchmark results & source code are here: https://github.com/gbb/ppppt Another set of benchmarks showing the same phenomena on PG9.3 and PG9.4 can be found here, under 'BENCHMARKS.md' https://github.com/gbb/par_psql I would be grateful if others could run the benchmark and confirm/disconfirm the result. If confirmed, the result may be of special interest to e.g. the postgis & pgrouting communities. This result is from a 16-core machine with 128GB of memory and a lot of random I/O capacity (there's no writing involved though other than a bit of WAL, and not much data, so this shouldn't matter). -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs