Re: SubtransControlLock and performance problems

Поиск
Список
Период
Сортировка
Искать
От
Laurenz Albe
Тема
Re: SubtransControlLock and performance problems
Дата
Msg-id
61eeb178848bdc2e0dd6c81ce94f3ace7c1348ff.camel@cybertec.at
Ответ на
Список
Дерево обсуждения
SubtransControlLock and performance problems Lars Aksel Opsahl <Lars.Opsahl@nibio.no>
Re: SubtransControlLock and performance problems Alvaro Herrera <alvherre@2ndquadrant.com>
Re: SubtransControlLock and performance problems Laurenz Albe <laurenz.albe@cybertec.at>
Re: SubtransControlLock and performance problems Lars Aksel Opsahl <Lars.Opsahl@nibio.no>
Re: SubtransControlLock and performance problems Laurenz Albe <laurenz.albe@cybertec.at>
Re: SubtransControlLock and performance problems Pavel Stehule <pavel.stehule@gmail.com>
Re: SubtransControlLock and performance problems Tom Lane <tgl@sss.pgh.pa.us>
Re: SubtransControlLock and performance problems Pavel Stehule <pavel.stehule@gmail.com>
Re: SubtransControlLock and performance problems Laurenz Albe <laurenz.albe@cybertec.at>
Re: SubtransControlLock and performance problems Pavel Stehule <pavel.stehule@gmail.com>
Re: SubtransControlLock and performance problems Lars Aksel Opsahl <Lars.Opsahl@nibio.no>
Re: SubtransControlLock and performance problems Alvaro Herrera <alvherre@2ndquadrant.com>
Re: SubtransControlLock and performance problems Lars Aksel Opsahl <Lars.Opsahl@nibio.no>
On Mon, 2020-02-17 at 15:03 +0000, 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. 
> 
> Can I based on this assume that the problem is only related to exceptions  ?

No, it is related to BEGIN ... EXCEPTION ... END blocks, no matter if
an exception is thrown or not.

As soon as execution enters such a block, a subtransaction is started.

> Does this mean that if have 32 threads running in parallel and I get 2 exceptions in each thread I have reached a state where I will get contention ?

No, it means that if you enter a block with an EXCEPTION clause more
than 64 times in a single transaction, performance will drop.

> Is it any way increase from 64 to a much higher level, when compiling the code ?

Yes, you can increase PGPROC_MAX_CACHED_SUBXIDS in src/include/storage/proc.h

> Basically what I do here is that I catch exceptions when get them and tries to solve the problem in a alternative way.

Either use shorter transactions, or start fewer subtransactions.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com



В списке pgsql-performance по дате отправления
От: Lars Aksel Opsahl
Дата:
От: Pavel Stehule
Дата:
FAQ