Back in May 2025, a certain billing platform's Postgres database rejected writes four times in a single week. During every incident, monitoring graphs showed more than half of the database's MultiXact capacity was still free.
Those dashboards weren't broken! They were just tracking the wrong limit.
Under heavy row-lock contention, Postgres relies on two separate counters that can run out. Nearly everyone monitors the first. The second counter took Metronome down, yet Postgres 13 through 18 expose zero metrics for it. You just have to measure it yourself.
How Did Metronome Suffer Four Outages With Green Dashboards?
Metronome's alerts only tracked MultiXact ID age, missing that a high-speed table backfill had quietly exhausted Postgres's separate MultiXact member space.
Metronome powers usage-based billing for software companies. Most of its live workload ran on one Amazon Aurora PostgreSQL 13.18 cluster exceeding 30 TB.
In April 2025, engineers began migrating a nearly 10 TB invoices table into a partitioned layout using dual writes and a heavy backfill. On May 7th, they rolled out a faster backfill worker. Three days later, on May 10th, write operations started failing across their API and UI.
The same failure struck again on May 16th and twice on May 17th, with each outage lasting over an hour.
Their alerts watched MultiXact ID age against autovacuum_multixact_freeze_max_age, left at its 400 million default. Emergency vacuums kicked off around 200 million, even while dashboards showed under 50% used. Only after four outages did the team realize Postgres had exhausted another resource, MultiXact member space.
CTO Cosmo Wolfe published a refreshingly candid root cause analysis (opens in new tab) that's worth reading in full.
I'll cover what that post leaves out, and that's a reproduction with concrete numbers, why vacuums fired at half the configured limit, and queries to track member space on self-hosted Postgres, RDS, and Aurora.
What Is a MultiXact, and Where Are Its Members Stored?
A MultiXact is a group ID Postgres creates when multiple transactions lock the same row, with its member transaction lists stored outside the table in pg_multixact/offsets and pg_multixact/members (more on that later).
Each tuple header in Postgres includes an xmax field. Normally, it holds one transaction ID, whichever transaction locked or deleted that row.
If xmin and xmax are new to you, check out my MVCC and vacuum article.
Because one header field cannot hold multiple IDs, Postgres handles concurrent locks differently. When a second transaction locks an already-locked row, Postgres bundles those transaction IDs into a MultiXact and assigns the group its own ID.
That MultiXact ID goes into the row's xmax, while the list of participating transactions, called members, is stored outside the table.
Postgres stores that data across two directories:
pg_multixact/offsetsmaps each MultiXact ID to where its member list begins.pg_multixact/membersholds the member lists themselves, where each entry pairs a transaction ID with a lock mode and takes about 5 bytes on disk.
Below, three open transactions have each inserted a child row referencing customer 42:
SELECT xmax FROM customers WHERE id = 42;
-- xmax
-- ------
-- 783
SELECT * FROM pg_get_multixact_members('783');
-- xid | mode
-- ------+-------
-- 1488 | keysh
-- 1489 | keysh
-- 1490 | keyshRow 42 in customers was never modified, yet three inserts into another table locked it.
Why Do Foreign Keys Create MultiXacts?
Inserting a row with a foreign key places a FOR KEY SHARE lock on the parent row, and when multiple transactions lock that same parent row concurrently, Postgres creates a new MultiXact for overlapping row locks. As more transactions join and remain open, total member usage grows quadratically.
Every foreign-key insert triggers a check query to confirm the parent row exists and won't disappear before commit:
SELECT 1 FROM ONLY <parent_table> x WHERE id = $1 FOR KEY SHARE OF xFOR KEY SHARE is Postgres's lightest row lock. It blocks deletes and key updates while letting many transactions hold the lock simultaneously so a hundred inserts for one customer don't stall behind each other.
My concurrency and locks article covers how these lock modes interact.
However, multiple transactions locking one row is the exact condition that triggers a MultiXact. Every overlapping foreign-key insert targeting the same parent row can lead to a new MultiXact.
The catch is immutability. When a third transaction joins a two-member group, Postgres cannot append to the existing MultiXact. Instead, it allocates a brand-new MultiXact containing all three active members (dropping finished ones) and updates the row pointer, leaving the old group on disk until vacuum can clear it.
When n concurrent transactions lock the same row and stay open, Postgres generates n - 1 MultiXacts containing 2 + 3 + ... + n members.
Postgres developer Thomas Munro shared that exact formula, n(n+1)/2 - 1, on the mailing list, and Metronome cited it in their postmortem.
MultiXact IDs scale linearly, while members scale quadratically.
What Are the Two MultiXact Limits, and Why Did Vacuums Fire at 50%?
Postgres enforces separate 32-bit limits for MultiXact IDs and MultiXact members, and once member usage crosses the halfway mark (about 2.15 billion members), Postgres dynamically lowers its freeze threshold and triggers aggressive vacuums across old tables.
| MultiXact IDs | MultiXact members | |
|---|---|---|
| What it counts | Groups | Transaction IDs inside all groups |
| Size of the counter | 32-bit, wraps like transaction IDs (about 2 billion usable) | 32-bit, about 4.29 billion |
| On disk | pg_multixact/offsets | pg_multixact/members, up to about 20 GB |
| What people watch | mxid_age(datminmxid) against autovacuum_multixact_freeze_max_age | Usually nothing |
Nearly every monitoring tool alerts solely on the first column. For instance, pganalyze's MultiXact ID wraparound check (opens in new tab) tracks ID age, which is why Metronome's dashboards stayed green.
The second column also explains why emergency vacuums fired at 200 million. Inside multixact.c, once active members pass half the available space (about 2.15 billion, or roughly 10 GB), MultiXactMemberFreezeThreshold() begins reducing the freeze age that autovacuum actually enforces:
- Below 2.15 billion members, autovacuum respects your configured 400 million setting.
- Above that mark, the effective freeze age drops to the current number of active MultiXacts minus a growing fraction as members approach three-quarters of capacity (about 3.22 billion), eventually hitting zero.
As soon as member usage crosses halfway, the effective freeze age dips right below the database's active MultiXact count. Every table holding MultiXacts that old immediately becomes eligible for aggressive anti-wraparound vacuuming. On a cluster with roughly 200 million active MultiXacts, every old table triggers at once while ID age stays at "50%".
The math checks out. 2.15 billion members divided across about 200 million MultiXacts averages roughly 11 members per MultiXact. That ratio is my own deduction from the source code and Metronome's numbers rather than a figure from their RCA.
Postgres 17 documentation (opens in new tab) briefly notes that once member storage passes roughly 10 GB, aggressive vacuums "will occur more often for all tables." What it omits is that this mechanism can slash the effective freeze age well below your configured threshold.
How Fast Does Member Usage Grow in a Postgres 13 Reproduction?
In my PostgreSQL 13.23 test, 400 overlapping inserts created 399 MultiXacts but consumed 80,199 member slots (201 members per ID), a rate that would exhaust member space at roughly 1% of the ID limit.
To get concrete numbers, I reproduced the behavior in Docker on PostgreSQL 13.23, matching Metronome's major version, using a minimal schema:
CREATE TABLE customers (id int PRIMARY KEY, name text);
CREATE TABLE invoices (
id bigserial PRIMARY KEY,
customer_id int NOT NULL REFERENCES customers(id),
amount numeric
);Running 200 sequential inserts for the same customer, committing each before starting the next, produced 0 MultiXacts and 0 members. When a single transaction holds the lock, it writes its own transaction ID straight into xmax.
Foreign keys by themselves are not the problem. Concurrent overlap causes the explosion.
Next, I opened n concurrent transactions, had each insert an invoice for that same customer, and held them open until every insert finished.
I captured counters from pg_control_checkpoint() after a CHECKPOINT before and after each batch:
| Overlapping inserts (n) | MultiXacts created | Members used | Members per MultiXact |
|---|---|---|---|
| 5 | 4 | 14 | 3.5 |
| 10 | 9 | 54 | 6 |
| 20 | 19 | 209 | 11 |
| 50 | 49 | 1,274 | 26 |
| 100 | 99 | 5,049 | 51 |
| 200 | 199 | 20,099 | 101 |
| 400 | 399 | 80,199 | 201 |
Every single row aligns with n - 1 and n(n+1)/2 - 1, with 5 lockers yielding 4 and 14 just like Metronome's example.
With 400 concurrent lockers, each MultiXact ID burns roughly 201 members, exhausting member space after about 21 million MultiXacts, or around 1% of the ID ceiling.
An ID-age alert set at 50% would never fire in time.
Across the full test, Postgres allocated 106,906 member slots and grew pg_multixact/members to 540,672 bytes (5.06 bytes per member). That lines up with the source code, where a four-member group takes 20 bytes and 409 groups fit inside an 8 KB page.
The entire Python benchmark script is under 50 lines (opens in new tab).
Why Can't Vacuum Reclaim MultiXact Member Space Quickly?
Postgres stores members in a single append-only log and only frees 256 KB segments up to the oldest relminmxid across every table in the cluster, so one unvacuumed giant table blocks cleanup for all of them.
Member storage operates as one continuous, append-only log where fresh entries always write to the tail. Postgres can only reclaim space from the oldest head in full 256 KB segments, and strictly up to the oldest MultiXact still referenced by any table across the entire cluster.
You can see this constraint inside vac_truncate_clog() and TruncateMultiXact(). As vacuum freezes old MultiXacts in a table, it advances that table's relminmxid, and Postgres finds the lowest value across all databases before truncating older member files.
Consequently, a single huge table lagging behind on vacuum pins the entire member log, even when every other table is spotless. Metronome's table approached 10 TB, and anti-wraparound vacuums across billions of rows tend to run for hours, leaving any write that requires a new MultiXact to fail throughout that window.
This mirrors the dead-tuple horizon problem I covered in my MVCC article, where one stale holdout stalls cleanup cluster-wide, and long-running transactions compound the issue by keeping old MultiXacts alive.
What Does the multixact "members" limit exceeded Error Mean?
Once member space runs out, Postgres blocks any write that needs a new MultiXact (SQLSTATE 54000), requiring you to halt concurrent writers, close stale sessions, and freeze the oldest relminmxid tables first.
As member capacity nears zero, Postgres rejects every command that requires a new MultiXact. Because concurrent foreign-key inserts constantly allocate them, write failures quickly cascade across the application.
Here is the exact error emitted by multixact.c, with sample numbers:
ERROR: multixact "members" limit exceeded
DETAIL: This command would create a multixact with 2 members, but the remaining space is only enough for 0 members.
HINT: Execute a database-wide VACUUM in database with OID 16384 with reduced vacuum_multixact_freeze_min_age and vacuum_multixact_freeze_table_age settings.
This maps to SQLSTATE 54000 (program_limit_exceeded), though your specific counts and database OID will vary.
Postgres logs only one advance warning, and it arrives very late, once you are within 20 segments (roughly one million members out of 4.29 billion) of the hard stop:
WARNING: database with OID 16384 must be vacuumed before 1000000 more multixact members are used
If either message appears in your logs, take these four recovery steps:
- Halt all MultiXact-generating writes. Pause both the primary job and any background workers draining its queue. Metronome suffered its third outage after stopping their backfill job while leaving queue consumers running.
- Terminate long-running and
idle in transactionsessions. Stale open transactions pin old MultiXacts and block truncation. - Vacuum tables by oldest
relminmxidfirst. Use the table-age query in the next section to prioritize targets, and lowervacuum_multixact_freeze_min_ageandvacuum_multixact_freeze_table_ageas the hint advises to maximize freezing. - Skip index cleanup during the first pass. Metronome recovered fastest by vacuuming table heaps first and cleaning indexes afterward, which on Postgres 13 is
VACUUM (FREEZE, INDEX_CLEANUP false).
How Do You Monitor MultiXact Member Space?
Track pg_multixact/members disk usage against its ~20 GB ceiling (or active members against ~4.29 billion), alerting well before 10 GB by querying directory sizes on self-hosted Postgres, rds_tools on RDS, or aurora_stat_file() on Aurora.
Aim to alert well ahead of the 10 GB threshold where surprise anti-wraparound vacuums kick in. I recommend warning at 5 GB (around 25%) and paging at 8 GB (around 40%), paired with a growth-rate alert. Those thresholds are my own rule of thumb rather than official defaults, so adjust them based on how long your largest table takes to vacuum.
Keep your MultiXact ID-age alert active alongside these checks. You need both.
How Do You Monitor MultiXact Members on Self-Hosted Postgres 13 to 18?
Before Postgres 19, no built-in SQL view reports member usage, so inspect the directory directly. From the shell:
du -sh "$PGDATA/pg_multixact/members"From SQL:
SELECT count(*) AS segment_files,
pg_size_pretty(sum(s.size)) AS members_on_disk,
round(sum(s.size) / 8192.0 * 1636) AS approx_members,
round(100 * sum(s.size) / 8192.0 * 1636 / 4294967296, 4) AS pct_of_member_space
FROM pg_ls_dir('pg_multixact/members') AS f,
LATERAL pg_stat_file('pg_multixact/members/' || f) AS s;On my reproduction instance, this query showed 3 files, 528 kB, roughly 107,976 members, and 0.0025% usage, closely matching the true count of 106,906.
By default, pg_ls_dir and pg_stat_file require superuser privileges and failed in my tests for both a standard role and a pg_monitor member. Grant execute permissions explicitly to your monitoring user:
GRANT EXECUTE ON FUNCTION pg_ls_dir(text) TO monitoring;
GRANT EXECUTE ON FUNCTION pg_stat_file(text) TO monitoring;To measure consumption velocity, sample pg_control_checkpoint(), which works for an unprivileged role without extra grants:
SELECT now() AS sampled_at,
next_multixact_id::text::bigint AS next_mxid,
next_multi_offset::text::bigint AS next_member_offset
FROM pg_control_checkpoint();Subtracting next_member_offset across two samples yields the members allocated during that interval.
Note that this counter updates only at checkpoints and wraps around a circular space at 4,294,967,296, so it tracks burn rate rather than total usage. Dividing remaining member capacity by your hourly burn rate tells you your runway.
Finally, monitor MultiXact ID age across databases and individual tables:
SELECT datname, mxid_age(datminmxid) AS mxid_age
FROM pg_database ORDER BY 2 DESC;
SELECT c.oid::regclass AS table_name, mxid_age(c.relminmxid) AS mxid_age
FROM pg_class c
WHERE c.relkind IN ('r', 'm', 't')
ORDER BY 2 DESC LIMIT 10;That second query gives you the exact vacuum priority order during an incident.
How Do You Track MultiXact Member Usage on Amazon RDS?
Because RDS does not grant true superuser access, the filesystem query above won't work. Instead, use rds_tools.pg_ls_multixactdir() from the rds_tools extension, which AWS's MultiXact blog post (opens in new tab) notes is supported on RDS for PostgreSQL 12.21+, 13.17+, 14.14+, 15.8+, 16.5+, and all 17 releases:
CREATE EXTENSION IF NOT EXISTS rds_tools;
SELECT pg_size_pretty(coalesce(sum(size), 0)) AS members_size
FROM rds_tools.pg_ls_multixactdir()
WHERE name LIKE 'pg_multixact/members/_%';As the rds_tools reference (opens in new tab) documents, the function also returns the directory entry itself, which is why the /_% filter is required.
How Do You Monitor MultiXact Members on Amazon Aurora?
Aurora lacks a local filesystem, ruling out both previous approaches. Instead, use aurora_stat_file() from the same AWS post to inspect allocated_bytes and used_bytes in Aurora storage:
CREATE EXTENSION IF NOT EXISTS aurora_stat_utils;
SELECT pg_size_pretty(sum(allocated_bytes)) AS allocated_bytes,
pg_size_pretty(sum(used_bytes)) AS used_bytes
FROM aurora_stat_file()
WHERE filename LIKE 'pg_multixact/members%';A Metronome engineer shared their production variant of this query (opens in new tab), which also tags writer and reader instances using pg_is_in_recovery().
Divide used_bytes by roughly 5 to estimate member count, though I haven't verified this ratio on Aurora myself.
Neither RDS nor Aurora expose a native CloudWatch metric for this. The Aurora and RDS metric lists include MaximumUsedTransactionIDs but nothing for MultiXacts. You must schedule the query yourself and push the result as a custom metric.
What Does Postgres 19 Change, and What Stays the Same?
Postgres 19 widens MultiXact offsets to 64 bits to eliminate the member hard stop and introduces pg_get_multixact_stats(), though MultiXact IDs remain 32-bit and member growth still triggers early aggressive vacuums.
Postgres 19 was released on November 19th 2026, and it removes the member ceiling altogether. Commit "Widen MultiXactOffset to 64 bits (opens in new tab)" lifts the 2^32 cap on members, eliminating the hard stop behind the members limit exceeded error.
The release notes (opens in new tab) summarize this change as "Make multixact members 64-bit."
Postgres 19 also introduces pg_get_multixact_stats(), which outputs num_mxids, num_members, members_size, and oldest_multixact. Roles lacking pg_read_all_stats receive NULL values, making pg_monitor membership sufficient:
SELECT num_mxids, num_members, pg_size_pretty(members_size) AS members_size, oldest_multixact
FROM pg_get_multixact_stats();Running my same reproduction on 19 RC1 returned 106,905 members consuming 534,525 bytes.
Several behaviors stayed unchanged:
- MultiXact IDs stay capped at 2^31: The commit message states this explicitly, so you still need your ID-age alert.
- Member growth still lowers the freeze threshold: The patch preserves the scaling logic around 2 billion and 4 billion members to rein in disk footprint, meaning surprise aggressive vacuums can still fire even without a write-blocking wall.
- The ID wraparound warning fires sooner: Postgres now warns at 100 million IDs before wraparound instead of 40 million.
Upgrading is always essential, especially since Metronome ran Postgres 13, which reached end-of-life on November 13th 2025. Until Postgres 19 lands on your managed provider, rely on the monitoring queries above.
Checklist: Which Five Alerts Should You Add?
To catch MultiXact member exhaustion early, alert on member disk size, hourly member growth rate, database MultiXact ID age, oldest table relminmxid values, and long-running transactions.
- Member space size: Track
pg_multixact/members(using filesystem,rds_tools, oraurora_stat_file) against its roughly 20 GB ceiling, warning at 5 GB and paging at 8 GB. - Member growth rate: Calculate members added per hour from
next_multi_offsetand estimate hours remaining until the 10 GB threshold. - MultiXact ID age: Monitor
mxid_age(datminmxid)against bothautovacuum_multixact_freeze_max_ageand the 2 billion wraparound limit. - Oldest tables: Track the highest
mxid_age(relminmxid)tables continuously so your vacuum order is ready before an incident hits. - Long transactions: Alert on any session, including
idle in transactionconnections, that stays open longer than your normal job duration.
Add one schema review alongside those alerts.
Audit foreign keys pointing to small, heavily contended parent tables (such as status or plan lookup tables) targeted by thousands of concurrent inserts. That pattern drives the lock overlap, and Metronome's follow-up list includes that exact check.
FAQ
Is "MultiXact member wraparound protections are now enabled" a problem?
No. Postgres writes this routine LOG message once it locates the oldest member, typically right after startup or crash recovery, confirming that wraparound protection is active.
What does "oldest multixact is far in the past" mean?
This VACUUM warning flags MultiXact ID age rather than member disk space. An open transaction is pinning an old MultiXact and blocking vacuum from freezing past it, so its hint advises closing open transactions holding MultiXacts promptly.
Is "MultiXactId has not been created yet" the same problem?
No. That error typically stems from data corruption, legacy Postgres 9.3 and 9.4 bugs, or a botched upgrade rather than MultiXact member exhaustion.







