From: Chris Withers <chris@withers.org>
To: pgsql-general <pgsql-general@postgresql.org>
Subject: debugging intermittent slow updates under higher load
Date: Wed, 5 Dec 2018 14:34:18 +0000
Message-ID: <bda6cf39-08ad-322f-d562-49c042cb4012@withers.org> (raw)
Hi All,
This is on postgres 9.4.16, same table as the last question I asked,
here's an abbreviated desc:
# \d alerts_alert
Table "public.alerts_alert"
Column | Type | Modifiers
-----------------+--------------------------+-----------
tags | jsonb | not null
id | character varying(86) | not null
...
Indexes:
"alerts_alert_pkey" PRIMARY KEY, btree (id)
The table has around 1.5M rows which have been updated/inserted around
121M times, the distribution of updates to row in alerts_alert will be
quite uneven, from 1 insert up to 1 insert and 0.5M updates.
Under high load (200-300 inserts/updates per second) we see occasional
(~10 per hour) updates taking excessively long times (2-10s). These
updates are always of the form:
UPDATE "alerts_alert" SET ...bunch of fields... WHERE
"alerts_alert"."id" = '...sha1 hash...';
Here's a sample explain:
https://explain.depesz.com/s/Fjq8
What could be causing this? What could we do to debug? What config
changes could we make to alleviate this?
cheers,
Chris
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: chris@withers.org
Subject: Re: debugging intermittent slow updates under higher load
In-Reply-To: <bda6cf39-08ad-322f-d562-49c042cb4012@withers.org>
References: <bda6cf39-08ad-322f-d562-49c042cb4012@withers.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox