Re: Occasional timeouts on TRUNCATE and simple INSERTs

From: Sergey Konoplev <gray(dot)ru(at)gmail(dot)com>
To: "Osborn, Jeff" <jeosborn(at)akamai(dot)com>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Occasional timeouts on TRUNCATE and simple INSERTs
Date: 2012-12-11 21:38:38
Message-ID: CAL_0b1u4VMcHrSVzZnLgCnqcb1S2s3iVHcmZTOYEtdxnuCVZuQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Tue, Dec 11, 2012 at 1:19 PM, Osborn, Jeff <jeosborn(at)akamai(dot)com> wrote:
> I am seeing some strange performance on a new pg9.1 instance. We are seeing occasional statement timeouts on some TRUNCATEs and INSERTs. In both cases, the statements are quite simple:
> - TRUNCATE schema.table;
> - INSERT INTO schema.table VALUES ($1,2,$2,'');
>
> Sometimes these will succeed. Occasionally I see timeouts. The statement_timeout is set to 60 seconds. These tables are not particularly large; in the case of the insert, the table only has three rows.

A most common case is when backup (pg_dump*) is running TRUNCATE has
to wait for it because it acquires an access exclusive lock on a table
and all other queries including INSERT have to wait for the TRUNCATE.
Check the backup case first.

> Our previous Postgresql 8.2 instance did not have this problem.

This is strange for me.

--
Sergey Konoplev
Database and Software Architect
http://www.linkedin.com/in/grayhemp

Phones:
USA +1 415 867 9984
Russia, Moscow +7 901 903 0499
Russia, Krasnodar +7 988 888 1979

Skype: gray-hemp
Jabber: gray(dot)ru(at)gmail(dot)com

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Merlin Moncure 2012-12-11 22:16:43 Re: Occasional timeouts on TRUNCATE and simple INSERTs
Previous Message Osborn, Jeff 2012-12-11 21:19:20 Occasional timeouts on TRUNCATE and simple INSERTs