Re: Postgres stucks in deadlock detection - Mailing list pgsql-hackers

From Evgeniy Shishkin
Subject Re: Postgres stucks in deadlock detection
Date
Msg-id 2ED40611-BBC2-43CF-B5A9-B48EA03030E1@gmail.com
Whole thread Raw
In response to Re: Postgres stucks in deadlock detection  (Konstantin Knizhnik <k.knizhnik@postgrespro.ru>)
List pgsql-hackers

> On Apr 5, 2018, at 11:03, Konstantin Knizhnik <k.knizhnik@postgrespro.ru> wrote:
>
> From the other side, the fact that any of this
>
> a) increasing deadlock timeout
> b) avoid concurrent execution of deadlock check
> c) perform first stage of deadlock check under shared lock
>
> have very noticeable effect on the observed behavior and some of them allow to completely eliminate the problem,
> makes me think that deadlock detection is not a symptom but the main source of the problem.

It seems to me that instead of running deadlock detection one-by-one you can use exponential backoff.
It should provide "good" degradation during high contention and does not make things bad on low contention.

Maybe you should combine it with Yura's patch for additional benefit and benchmark it on different contentions.

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [HACKERS] path toward faster partition pruning
Next
From: Andres Freund
Date:
Subject: Re: Postgres stucks in deadlock detection