Re: SubtransControlLock and performance problems

2020-02-20 Thread Lars Aksel Opsahl
Hi >From: Alvaro Herrera >Sent: Wednesday, February 19, 2020 4:23 PM >To: Lars Aksel Opsahl >Cc: Laurenz Albe ; Pavel Stehule >; Tom Lane ; >pgsql-performance@lists.postgresql.org >Subject: Re: SubtransControlLock and performance

Re: SubtransControlLock and performance problems

2020-02-19 Thread Alvaro Herrera
On 2020-Feb-19, Lars Aksel Opsahl wrote: > With the values above I did see same performance problems and we ended > with a lot of subtransControlLock. > > So I started to change the code based on your feedbacks. > > - What seems to work very good in combination with a catch exception > and retry

Re: SubtransControlLock and performance problems

2020-02-19 Thread Lars Aksel Opsahl
Hi >From: Laurenz Albe >Sent: Tuesday, February 18, 2020 6:27 PM >ATo: Pavel Stehule ; Tom Lane >Cc: Lars Aksel Opsahl ; >pgsql-performance@lists.postgresql.org >Subject: Re: SubtransControlLock and performance problems >

Re: SubtransControlLock and performance problems

2020-02-18 Thread Pavel Stehule
út 18. 2. 2020 v 18:27 odesílatel Laurenz Albe napsal: > On Mon, 2020-02-17 at 19:41 +0100, Pavel Stehule wrote: > > I tested > > > > CREATE OR REPLACE FUNCTION public.fx(integer) > > RETURNS void > > LANGUAGE plpgsql > > AS $function$ > > begin > > for i in 1..$1 loop > > begin > > ins

Re: SubtransControlLock and performance problems

2020-02-18 Thread Laurenz Albe
On Mon, 2020-02-17 at 19:41 +0100, Pavel Stehule wrote: > I tested > > CREATE OR REPLACE FUNCTION public.fx(integer) > RETURNS void > LANGUAGE plpgsql > AS $function$ > begin > for i in 1..$1 loop > begin > insert into foo values(i); > exception when others then > raise notice 'yyy';

Re: SubtransControlLock and performance problems

2020-02-17 Thread Alvaro Herrera
On 2020-Feb-16, Lars Aksel Opsahl wrote: > On a server with 32 cores and 250 GB memory, with CentOS 7 and kernel > 4.4.214-1.el7.elrepo.x86_64, I try to run 30 parallel threads using > dblink. (https://github.com/larsop/postgres_execute_parallel) . I have > tried to disconnect and reconnect in the

Re: SubtransControlLock and performance problems

2020-02-17 Thread Pavel Stehule
po 17. 2. 2020 v 19:23 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > po 17. 2. 2020 v 17:36 odesílatel Laurenz Albe > > > napsal: > >> Either use shorter transactions, or start fewer subtransactions. > > > it is interesting topic, but I don't see it in my example > > > CREATE OR REPLA

Re: SubtransControlLock and performance problems

2020-02-17 Thread Tom Lane
Pavel Stehule writes: > po 17. 2. 2020 v 17:36 odesílatel Laurenz Albe > napsal: >> Either use shorter transactions, or start fewer subtransactions. > it is interesting topic, but I don't see it in my example > CREATE OR REPLACE FUNCTION public.fx(integer) > RETURNS void > LANGUAGE plpgsql >

Re: SubtransControlLock and performance problems

2020-02-17 Thread Pavel Stehule
Hi po 17. 2. 2020 v 17:36 odesílatel Laurenz Albe napsal: > On Mon, 2020-02-17 at 15:03 +, Lars Aksel Opsahl wrote: > > I have tested in branch ( > https://github.com/larsop/resolve-overlap-and-gap/tree/add_postgis_topology_using_func > ) > > where I use only have functions and no procedures

Re: SubtransControlLock and performance problems

2020-02-17 Thread Laurenz Albe
On Mon, 2020-02-17 at 15:03 +, Lars Aksel Opsahl wrote: > I have tested in branch ( > https://github.com/larsop/resolve-overlap-and-gap/tree/add_postgis_topology_using_func) > where I use only have functions and no procedures and I still have the same > problem with subtransaction locks. >

Re: SubtransControlLock and performance problems

2020-02-17 Thread Lars Aksel Opsahl
>From: Laurenz Albe >Sent: Monday, February 17, 2020 10:53 AM >To: Lars Aksel Opsahl ; >pgsql-performance@lists.postgresql.org >Subject: Re: SubtransControlLock and performance problems > >Lars Aksel Opsahl wrote: >> What happens is that after some minutes t

Re: SubtransControlLock and performance problems

2020-02-17 Thread Laurenz Albe
Lars Aksel Opsahl wrote: > What happens is that after some minutes the CPU can fall to maybe 20% usage > and most of > the threads are blocked by SubtransControlLock, and when the number > SubtransControlLock > goes down the CPU load increases again. The jobs usually goes through without > any e