Re: Waiting on ExclusiveLock on extension - Mailing list pgsql-general

From Qingqing Zhou
Subject Re: Waiting on ExclusiveLock on extension
Date
Msg-id CAJjS0u3hty3MjyRqeMkEW=M7TQjt5kEvXw+LW6Y83qXqun=FhQ@mail.gmail.com
Whole thread Raw
In response to Waiting on ExclusiveLock on extension  (Andomar <andomar@aule.net>)
Responses Re: Waiting on ExclusiveLock on extension
Re: Waiting on ExclusiveLock on extension
List pgsql-general
On Thu, Apr 16, 2015 at 1:24 PM, Andomar <andomar@aule.net> wrote:
> After upgrading our database from 9.3.5 to 9.4.1 last night, the server
> suffers from high CPU spikes. During these spikes, there are a lot of these
> messages in the logs:
>
>     process X still waiting for ExclusiveLock on extension of relation Y of
> database Z after 1036.234 ms
>
This issue has been complained several times, and here is the most recent one:
http://www.postgresql.org/message-id/0DDFB621-7282-4A2B-8879-A47F7CECBCE4@simply.name

PG 9.4.1 shall have much alleviated it by relaxing buffer pool related
locks. PG 9.4.1 shall be actually better in relation extension
handling - a possible explanation is that your 9.3.5 database has been
used for a while thus there are holes in pages, so not many extensions
are required.

>
> a) I'm assuming "extension" means growing the physical diskspace used by a
> table-- is that correct?
Yes.

> b) How can you find the name of the relation being extended? based on the
> relation number.
select <number>::regclass;

> c) Why would Postgres grow a table twice in the same millisecond? Could it
> be an index with a high fill factor?
PG extends one page each time when new space needed.

> Any suggestions on how to approach this issue are welcome.
>
There are some diagnosis in above link, see if it rings any bell. From
PG kernel side, I think fundamentally we may want to extend many pages
each time instead of one.

Regards,
Qingqing


pgsql-general by date:

Previous
From: Octavi Fors
Date:
Subject: database migration question between different ubuntus and different postgresql server versions
Next
From: Adrian Klaver
Date:
Subject: Re: database migration question between different ubuntus and different postgresql server versions