Re: stuck spin lock with many concurrent users

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
Cc: Inoue(at)tpf(dot)co(dot)jp, pgsql-hackers(at)postgresql(dot)org
Subject: Re: stuck spin lock with many concurrent users
Date: 2001-06-26 13:47:34
Message-ID: 2824.993563254@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp> writes:
> In my understanding the deadlock check is performed every time the
> backend aquires lock. Once the it aquires, it kill the timer. However,
> under heavy transactions such as pgbench generates, chances are that
> the checking fires, and it tries to aquire a spin lock. That seems the
> situation.

It could be that with ~1000 backends all waiting for the same lock, the
deadlock-checking code just plain takes too long to run. It might have
an O(N^2) or worse behavior in the length of the queue; I don't think
the code was ever analyzed for such problems.

Do you want to try adding some instrumentation to HandleDeadlock to see
how long it runs on each call?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-06-26 14:18:37 Re: Re: Encrypting pg_shadow passwords
Previous Message Tom Lane 2001-06-26 13:42:11 Re: stuck spin lock with many concurrent users