Re: weird issue with occasional stuck queries

From: spiral <spiral(at)spiral(dot)sh>
To: Adam Scott <adam(dot)c(dot)scott(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: weird issue with occasional stuck queries
Date: 2022-04-02 12:23:39
Message-ID: 20220402082339.76e712d3@xps
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hey,

> That wait event according to documentation is "Waiting to access the
> multixact member SLRU cache." SLRU = segmented least recently used
> cache

I see, thanks!

> if you are low on memory, it can slow down the allocation of
> buffers. Do you have a query that is a "select for update" running
> somewhere? If your disk is low on space `df -h` that might explain
> the issue.

- There aren't any queries that are running for longer than the selects
shown earlier; definitely not "select for update" since I don't ever
use that in my code.
- Both disk and RAM utilization is relatively low.

> Is there an ERROR: multixact something in your postgres log?

There isn't, but while checking I saw some other concerning errors
including "deadlock detected", "could not map dynamic shared memory
segment" and "could not attach to dynamic shared area".
(full logs here: https://paste.sr.ht/blob/9ced99b119c3fce1ecfd71e8554946e7845a44dd )

> Another thing to look at is `iostat -x -y` and look at disk util %.
> This is an indicator, but not definitive, of how much disk access is
> going on. It may be your drives are just saturated although your
> IOWait looks ok in your attachment.

I didn't specifically look at that, but I did notice *very* high disk
utilization in at least one instance of the stuck queries, as I
mentioned previously. Why would the disks be getting saturated? The
query count isn't noticeably higher than average, and the database
is not autovacuuming, so not sure what could cause that.

spiral

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rob Sargent 2022-04-02 13:21:00 Re: How long does iteration over 4-5 million rows usually take?
Previous Message Ron 2022-04-02 02:18:45 Re: How long does iteration over 4-5 million rows usually take?