From: | Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> |
---|---|
To: | James Pang <jamespang886(at)gmail(dot)com> |
Cc: | pgsql-performance(at)lists(dot)postgresql(dot)org |
Subject: | Re: many backends hang on MultiXactOffsetSLRU |
Date: | 2024-09-10 09:00:14 |
Message-ID: | 202409100900.uzdfq7mn5o2c@alvherre.pgsql |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-performance |
On 2024-Sep-10, James Pang wrote:
> There is no foreign keys, but there is one session who did transactions
> to tables with savepoints, one savepoints/per sql in same transaction. But
> sessions with query "SELECT “ do not use savepoints , just with a lot of
> sessions running same query and hang on MultiXact suddenly. even only one
> session doing DML with savepoints , and all other queries sessions can see
> this kind of "MultiXact" waiting ,right?
I think SELECT FOR UPDATE combined with savepoints can create
multixacts, in absence of foreign keys.
A query that's waiting doesn't need to have *created* the multixact or
subtrans -- it is sufficient that it's forced to look it up.
If thousands of sessions tried to look up different multixact values
(spread across more than 8 pages), then thrashing of the cache would
result, with catastrophic performance. This can probably be caused by
some operation that creates one multixact per tuple in a few thousand
tuples.
Maybe you could ease this by doing VACUUM on the table (perhaps with a
low multixact freeze age), which might remove some of the multixacts.
--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
"Para tener más hay que desear menos"
From | Date | Subject | |
---|---|---|---|
Next Message | David Mullineux | 2024-09-10 13:58:03 | Has gen_random_uuid() gotten much slower in v17? |
Previous Message | Amine Tengilimoglu | 2024-09-10 08:53:58 | Re: many backends hang on MultiXactOffsetSLRU |