Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nafEa-0007DE-Pw for pgsql-general@arkaria.postgresql.org; Sat, 02 Apr 2022 15:00:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nafEZ-00069d-NW for pgsql-general@arkaria.postgresql.org; Sat, 02 Apr 2022 15:00:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nacnH-0006kd-KO for pgsql-general@lists.postgresql.org; Sat, 02 Apr 2022 12:23:51 +0000 Received: from out2.migadu.com ([188.165.223.204]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nacnC-0003So-PA for pgsql-general@postgresql.org; Sat, 02 Apr 2022 12:23:50 +0000 Date: Sat, 2 Apr 2022 08:23:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spiral.sh; s=key1; t=1648902224; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BzgDmSMOk6DLoer2Nt+t/j0+eB1BOooLg78pktOlhlI=; b=BD+OjgTMa4upFv98pvwoJ/16w68PfLp4Fj3tGu2RbySn4yIjuPPNP+wSHM/0nEYVjT3io7 5ECJOYh8tW1qczD9zPymRoZS9BflTtgqtNVDYVRAfI6IEliGxzEnAu0Me3xK1UUfPWSWQb qfmQzf7w9S3o6Z339zPZgJh3SyhXLkR9z2h0AOIqqlrpklTdbBgWohZHHnkPJI1Xxp6OkZ /aDACaM1kpQOM8+Ox0AbWYSqNAsVODeFMLKWt8cRwEt/mHqnsUKW7fDQ4vWijIrZeMAetd W30FchB7bdeLjBPBTtMAdHpNdmrWHkPIZsBN6iEMyKeutq3kdyAeNgLTPrCtVQ== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: spiral To: Adam Scott Cc: pgsql-general@postgresql.org Subject: Re: weird issue with occasional stuck queries Message-ID: <20220402082339.76e712d3@xps> In-Reply-To: References: <20220401030646.4eaad5a4@xps> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: spiral.sh List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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