SurferCloud Blog SurferCloud Blog
  • HOME
  • NEWS
    • Latest Events
    • Product Updates
    • Service announcement
  • TUTORIAL
  • COMPARISONS
  • INDUSTRY INFORMATION
  • Telegram Group
  • English
    • 中文 (中国)
    • English
SurferCloud Blog SurferCloud Blog
SurferCloud Blog SurferCloud Blog
  • HOME
  • NEWS
    • Latest Events
    • Product Updates
    • Service announcement
  • TUTORIAL
  • COMPARISONS
  • INDUSTRY INFORMATION
  • Telegram Group
  • English
    • 中文 (中国)
    • English
  • banner shape
  • banner shape
  • banner shape
  • banner shape
  • plus icon
  • plus icon

Cross-Region Postgres Replication: The Commit Ceiling Is a Round Trip

November 27, 2026
19 minutes
INDUSTRY INFORMATION
23 Views

A cross-region PostgreSQL standby is not a copy of your database. It is a copy plus a clock, and the clock has four hands. SurferCloud's Los Angeles plans start at $4.25/mo with 200 Mbps and no fixed traffic, which is the cheapest way we know of to give that clock enough room to catch up after a bad night on the wire. Everything below is about the clock: how it is built, which hand your recovery point objective actually depends on, and the arithmetic that tells you whether the far side can ever close a gap.

Most teams size the standby like they size the primary — same vCPU, same RAM, same disk — and then discover that none of those numbers were the binding constraint. The binding constraint is a rate, not a capacity. WAL is produced continuously at whatever pace your writes produce it, and the standby has to consume it at a rate strictly greater than that, forever, or the gap stops closing. That is a different kind of requirement from "enough disk", and it is the one that quietly fails six weeks after go-live.

The lag column is four numbers wearing one label

PostgreSQL exposes replication state in pg_stat_replication. The columns people watch are write_lag, flush_lag and replay_lag, and the instinct is to treat whichever one is largest as "the lag". They measure different things, and each one has a different owner. When one of them grows, the fix is different, and applying the wrong fix makes the number look better without making the system safer.

Stage What the standby has done at this point What makes it grow Who owns the fix
Sent Primary has pushed the WAL record onto the wire Sender blocked on socket write, or the primary is CPU-bound in WAL generation Bandwidth on the primary's egress, and max_wal_senders headroom
Write Standby has written the record to its own WAL buffers and file system Standby disk write latency; a shared or throttled volume Storage on the standby
Flush Standby has flushed to durable storage fsync latency, battery-backed cache absent, disk contention with read queries Storage, again, but a different layer
Replay Standby has applied the record so queries can see it Long read queries holding snapshots, conflict cancellation, single-threaded replay max_standby_streaming_delay, hot_standby_feedback, query design
The four stages are sequential. A healthy stream can still show a large replay figure while the network is perfect, which is why "the link is slow" is the most common wrong diagnosis in this area.

There is a measurement floor you should know before you build a dashboard. The standby reports its positions to the primary at most once per wal_receiver_status_interval, which defaults to 10 seconds. The documentation is explicit that the value is the maximum time between reports, and that the apply position may lag slightly behind the true position. So a 10-second default means your monitoring cannot resolve anything finer than roughly that window, and a graph that shows a two-second spike is showing you an artifact of the reporting interval, not a two-second stall. If you need one-second resolution, you change the interval; you do not change the chart.

Which hand your RPO depends on

Durability on the standby is not a property of the standby. It is a property of what the primary was told to wait for at commit time, which is synchronous_commit. The five settings wait for progressively more, and each one moves the guarantee — and the commit cost — to a different place.

synchronous_commit Commit waits until Survives standby PG crash Survives standby OS crash Visible on standby at commit
off Nothing. Local flush happens later, within about three times wal_writer_delay No No No
local Local WAL flushed to disk only No No No
remote_write Standby received and wrote to its file system Yes No No
on (default) Standby received and flushed to durable storage Yes Yes No
remote_apply Standby received, flushed, and applied Yes Yes Yes
Derived from Table 19.1 in the PostgreSQL 19 documentation. The last two columns are the ones that decide whether a read replica can serve a read-your-writes workload.

The practical consequence is that on — the default — buys you durability but not visibility. A transaction can be fully committed and safely stored on the standby while a query on that standby still cannot see it, because flush and replay are different stages. That is the entire reason PostgreSQL 19 added a way for a standby session to wait for a specific log position before answering: the release notes describe support for read-your-writes consistency on standbys via the new WAIT command, and the syntax lets a session wait for an LSN to be written, flushed, or replayed, with an optional timeout.

This is a real change in what you can build. Before it, read-your-writes across regions meant either pinning the user to the primary for a window, or carrying your own LSN through the request and polling by hand. Now the wait is a database operation. The timeout behaviour matters more than the syntax: a timeout means the wait did not satisfy the condition, not that the standby is now caught up. Treat a timeout as a failure and route the read to the primary, or you have built a system that silently returns stale data under load — precisely when you least want it to.

The commit ceiling is one round trip, unless you batch

Here is the number that decides whether synchronous replication across regions is viable for your workload, and it is arithmetic you can do before you rent anything. Under synchronous_commit = on, a commit cannot return until the standby's acknowledgement has travelled back. That is at minimum one network round trip per commit. A single client committing serially therefore has a hard ceiling of one commit per RTT, and no amount of CPU fixes it.

Path Approximate RTT floor Serial commit ceiling, one client Ceiling with 50 concurrent committers, batched
Same rack, same switch 0.2–0.5 ms 2,000–5,000 commits/s Effectively your disk, not the network
Same metro, two buildings 1–5 ms 200–1,000 commits/s Well above any OLTP workload you have
Neighbouring country ~30 ms ~33 commits/s ~1,600 commits/s
Cross-continent, 8,000 km ~80 ms ~12 commits/s ~600 commits/s
Hong Kong to Los Angeles, 11,600 km ~116 ms ~8 commits/s ~430 commits/s
RTT floors are computed from the speed of light in fibre, about 5 microseconds per kilometre one way, so roughly 10 microseconds per kilometre round trip. Real paths run above the floor; the measured Hong Kong figures are in the region-selection arithmetic piece. Column four assumes group commit amortises one round trip across concurrent sessions, which is a property of concurrency you may not have.

Two observations follow. The first is that the fourth column is the only reason cross-continent synchronous replication works at all in production: PostgreSQL commits in groups, so fifty sessions committing at the same moment share one round trip. The second is that a workload with low concurrency and high per-transaction value — a payment authorisation, an inventory decrement on a single hot row — never gets to share. If you have one session committing eight times a second, you are already at the ceiling before you have done anything wrong.

This is also the case where the difference between remote_write and on stops being academic. remote_write saves the standby's fsync, not the round trip, so on a 116 ms path it removes a small fraction of the wait. The round trip is the floor, and only distance or concurrency moves it. If you need both durability and regional isolation, the honest architecture is usually asynchronous replication with a measured lag budget and a promotion runbook, not synchronous replication pretending the ocean is not there.

WAL is billed by write rate, not by query rate

Now the part that shows up on the invoice. A standby consumes network in proportion to how much WAL the primary generates, which is a function of your writes — not your reads, not your query volume, not your request count. Teams consistently underestimate this because they reason from request rate, and request rate and WAL rate are not related in any fixed way: a single UPDATE on a wide row with three indexes can emit more WAL than a thousand point reads.

Steady-state WAL rate Continuous bandwidth Monthly volume Gap to close after a 2-hour outage
0.25 MB/s 2 Mbps ~648 GB 1.8 GB
1 MB/s 8 Mbps ~2.6 TB 7.2 GB
4 MB/s 32 Mbps ~10.4 TB 28.8 GB
10 MB/s 80 Mbps ~25.9 TB 72 GB
Monthly volume assumes 30 days of continuous production at the stated rate. The right-hand column is the accumulation during a two-hour stream interruption, which is what the link has to absorb once it comes back.

That last column is where the tiers start to matter, because the catch-up is a burst and the steady state is not. A link sized only for the steady state will pass every test you run on a quiet afternoon and fail on the first real night.

Line rate Effective throughput Time to clear 7.2 GB (1 MB/s WAL, 2-hour gap) Verdict for a cross-region standby
2 Mbps dedicated ~0.25 MB/s ~8 hours Cannot outrun a 1 MB/s write rate while also closing a gap. The gap never closes.
5 Mbps dedicated ~0.63 MB/s ~3.2 hours Closes a gap only if the write rate stays below roughly 0.6 MB/s
10 Mbps dedicated ~1.25 MB/s ~1.6 hours Workable if steady-state WAL is under about 1 MB/s
200 Mbps, no fixed traffic ~25 MB/s ~5 minutes Absorbs the burst; the constraint moves to disk and replay
The rule is one line: catch-up throughput must exceed the steady-state WAL rate, or the gap is permanent. Everything else is how much margin you want.

Note what the 200 Mbps row really buys on the SurferCloud Los Angeles plans. It does not make your replication faster in the steady state — a 1 MB/s stream uses one two-hundredth of a 200 Mbps line. It buys the right to be wrong about the network once. When the path goes down for two hours, the difference between a five-minute recovery and an eight-hour one is not a faster database; it is a line that was never sized for the average. And because that page carries no fixed traffic allowance, the catch-up burst is not a line item — which matters, because a burst is exactly the traffic shape that metered plans punish. The distinction between unmetered and unlimited is worth reading carefully before you count on it, and there is a separate piece on what unmetered actually meters.

Three defaults that end the stream quietly

These are not exotic. They are the shipped values, and each one fails silently in a different way.

wal_sender_timeout is 60 seconds. A replication connection idle for longer than that is terminated so the sender can detect a dead standby. On a long path with a congested return leg, an acknowledgement can be late enough to trip this — and what you see is a stream that "randomly" restarts, with catch-up traffic afterwards. The documentation notes that a larger value helps judge the health of a standby on a high-latency link. If your RTT is 116 ms and your path has any jitter at all, 60 seconds is not generous.

max_slot_wal_keep_size defaults to -1, meaning unlimited. A replication slot will retain WAL for as long as the standby needs it. That is the correct behaviour for replication and the wrong behaviour for your disk: a standby that is down for a weekend can fill the primary's volume with WAL that exists only to be shipped. The failure is not gradual — the primary runs out of space and stops accepting writes, which means your "redundant" configuration has just taken down the primary. Set a finite value and accept the trade: if the slot falls too far behind, the standby loses its position and needs a fresh base backup instead of a resumption.

max_standby_streaming_delay is 30 seconds, and hot_standby_feedback is off. Together these decide what happens when a read query on the standby conflicts with incoming WAL. By default the standby will cancel the query after 30 seconds of accumulated apply delay. Turning on feedback avoids the cancellations by telling the primary to hold back cleanup, which is a real cost paid on the primary as bloat. There is no free setting here, only a choice about who absorbs it. What you should not do is leave both at default and then treat cancelled analytics queries as a mystery.

The same logic applies to the disk you attach to the standby. A standby does two write-heavy things at once — receiving WAL and applying it — while also serving read queries. That is a different I/O profile from the primary, and it is the reason a standby built from the same plan as the primary can still show a replay figure you cannot explain. When the apply stage is slow, the queue in front of it is a queue, and the arithmetic of queues is the subject of this piece on latency under load.

What to put on the far side

Two shapes cover most cases, and they are priced very differently because they solve different halves of the problem. The SurferCloud Los Angeles plans are the burst absorber: 200 Mbps with no fixed traffic, on a fixed monthly price that does not change at renewal. The UHost plans are the ones with dedicated bandwidth tiers, which is the right purchase when the requirement is a predictable floor rather than a large ceiling.

Los Angeles plan vCPU / RAM NVMe Bandwidth Price Renews at
Starter 2 / 1 GB 30 GB 200 Mbps, no fixed traffic $4.25/mo (list $5.00, 15% off) $4.25/mo
Growth 2 / 2 GB 40 GB 200 Mbps, no fixed traffic $5.25/mo (list $7.50, 30% off) $5.25/mo
Pro 2 / 4 GB 50 GB 200 Mbps, no fixed traffic $8.05/mo (list $11.50, 30% off) $8.05/mo
Prices and specifications read from the rendered Los Angeles promotion page on 2026-11-27. All three include one dedicated IPv4, licensed Windows or Linux, and are billed monthly or yearly only. The page lists no disk-expansion option for these plans, so treat 30–50 GB as the ceiling.

The 50 GB ceiling is the honest limit of this shape, and it decides the use case more than the bandwidth does. Fifty gigabytes holds a dataset plus WAL headroom for a small database — a few tens of millions of rows, or a service whose hot data is a fraction of its total. It does not hold a standby for a multi-hundred-gigabyte primary, and no amount of 200 Mbps fixes that. Buy this plan when the dataset fits and the risk you are insuring against is a network outage; buy something else when the dataset does not fit.

UHost plan vCPU / RAM Dedicated bandwidth Promotional price List price
2C 2G 2 / 2 GB 1–2 Mbps $6.9/mo $34.16/mo
2C 4G 2 / 4 GB 2–5 Mbps $10.9/mo $42.82/mo
4C 8G 4 / 8 GB 2–5 Mbps $18.9/mo $78.85/mo
8C 16G 8 / 16 GB 5–10 Mbps $36.9/mo $161.10/mo
16C 32G 16 / 32 GB 5–10 Mbps $68.9/mo $305.21/mo
Prices read from the rendered UHost promotion page on 2026-11-27. Traffic is unmetered on every tier; the disk is 40 GB by default, or 20 GB at São Paulo and Dubai, expandable to 500 GB. The page separates a new-user deal capped at one server per customer, with renewal at the regular price, from an all-user deal capped at five servers with the renewal price locked — confirm which applies to your account in the console.

Read the bandwidth column against the tables above and the tiers become a decision rather than a price ladder. Two megabits is 0.25 MB/s: fine for a primary writing a quarter of a megabyte per second, permanently behind for one writing one megabyte per second. Ten megabits is 1.25 MB/s, which is the first tier with real headroom for a small OLTP workload. The UHost page also runs these across 17 availability zones with a 99.95% availability commitment and kernel hot patching, which matters here for a specific reason: a standby you have to reboot for a kernel security update is a standby that is not receiving WAL. The mistake is not buying the small tier — it is buying it, watching replay lag climb for a month, and concluding that replication "does not work across regions".

Two failure modes are worth naming directly, because both cost money in opposite directions. The first is buying 200 Mbps of burst capacity for a standby whose dataset does not fit in 50 GB — you have solved a network problem you did not have and left the disk problem in place. The second is buying a 2 Mbps dedicated line for a primary writing 4 MB/s — 4 MB/s needs 32 Mbps, so the standby is behind on day one and stays behind until you re-provision. Neither is a hardware fault.

The sequence that avoids both

  1. Measure the primary's WAL rate over a normal week, not a quiet hour. On the primary, compare the WAL position at two points a day apart; the difference divided by the elapsed seconds is your steady-state rate. Take the busiest day, not the median.
  2. Multiply by 8 to get continuous Mbps, then multiply by at least three for catch-up headroom. If the product is under 10 Mbps, a dedicated tier is defensible. If it is above roughly 100 Mbps, you are no longer buying a plan, you are buying a network — talk to an account manager about the shape before you order.
  3. Check the dataset against the plan's disk. For the Los Angeles plans that is 30 to 50 GB including WAL headroom; for UHost it starts at 40 GB and expands to 500 GB.
  4. Set max_slot_wal_keep_size, pick a deliberate wal_sender_timeout, and decide the hot_standby_feedback question before you hand the replica to an analytics team. These three settings are the difference between a replica and a Monday morning incident.
  5. Promote it once, on purpose, in a maintenance window. A standby that has never been promoted is a hypothesis, and the gap between hypothesis and plan is where most cross-region designs fail.

The order matters. Sizing before measuring produces either over-provisioning or the permanent-gap case, and the permanent-gap case is the one that looks fine for weeks. Once the rate and the disk both fit, the purchase itself is short: pick the Los Angeles plan that matches your disk footprint from the Los Angeles high-bandwidth page, or the UHost tier that matches your write rate from the elastic compute page, choose the region closest to the readers rather than the writers, and deploy. The current Los Angeles offer inventory is itemised in this breakdown of every live Los Angeles offer.

What a cross-region standby does not fix

Three things, stated plainly, because each one is a common reason people are disappointed by a design that is working as specified.

It is not a backup. A standby replicates the effect of a mistaken DELETE in milliseconds, at full speed, with no delay and no version history. Recovery from logical error needs a snapshot, a PITR window, or a delayed replica — and a delayed replica is a fourth thing with its own operational cost. If your only copy of yesterday exists on a streaming standby, you do not have yesterday.

It does not remove the single-writer bottleneck. Every row in the standby is applied by one replay process on the primary's timeline. A primary that is CPU-saturated by index maintenance will produce WAL that the standby applies one record at a time; adding replicas adds readers, not write throughput.

It does not make a read replica safe to hand to everyone. Conflict cancellation, snapshot age, and the flush-versus-replay gap all mean a replica can be a slightly different database from the primary at any instant. Applications that treat it as identical will produce intermittent, unreproducible bugs — the worst kind, because they disappear when you add logging.

Two things that changed this month

PostgreSQL 19 was released on 19 November 2026, and two of its changes are directly relevant to anyone running this architecture. Logical replication can now be enabled without a server restart when wal_level is set to replica, which removes a scheduling constraint that used to force a maintenance window before you could add a logical subscriber. And sequence values are now replicated, closing a long-standing gap that made logical replication awkward for tables with serial keys.

Neither changes the arithmetic above. The round trip is still the round trip, and WAL is still produced at your write rate. What they change is the cost of trying — and for a design where the main risk is that you never tested promotion, a lower cost of trying is worth more than a faster wire.

Questions that come up before the first deployment

Can I use the same plan for both sides? You can, but they are doing different jobs. The primary is compute-bound and the standby is I/O- and network-bound during catch-up. The plan that matches the standby's job is usually the one with more bandwidth and less CPU than you would guess.

Is asynchronous replication with a lag budget acceptable? For most web workloads, yes, if the budget is measured rather than assumed. The failure mode is not "we chose async"; it is "we chose async and never measured what a two-hour partition does to the gap".

How much disk headroom does the standby need? Enough for the dataset plus the WAL a slot may retain. Since the default retention is unlimited, your headroom requirement is technically unbounded until you set a limit. Set the limit first, then size the disk from it.

Does the region choice belong to the writers or the readers? Readers, for a read replica. But if you are running synchronous replication, the commit path goes to the writers' region and back, so the latency you are paying for is the writers' — which is why the two designs lead to different region choices from the same map. The Hong Kong and Singapore node pieces cover the reader-side arithmetic for Asia: Hong Kong and Singapore.

The one-line version: measure the WAL rate first, multiply for catch-up headroom, then buy a plan whose disk fits the dataset and whose bandwidth exceeds the rate. Everything else in this configuration is a setting, and settings are cheaper to change than architectures. Start from the Los Angeles 200 Mbps plans if your dataset fits 50 GB and your risk is the wire; start from the UHost tiers if you need a dedicated bandwidth floor across 17 availability zones.

Tags : Cloud Server PostgreSQL on VPS SurferCloud SurferCloud Promotion VPS Hosting

Related Post

4 minutes INDUSTRY INFORMATION

Thailand VPS Starting at $1/Month – Reliabl

Introduction Finding a reliable, high-performance VP...

3 minutes INDUSTRY INFORMATION

Static IP vs Dynamic IP: Understanding the Di

When choosing an IP address for your network or server,...

2 minutes INDUSTRY INFORMATION

SurferCloud Black Friday: 4C8G Lightweight Se

SurferCloud’s Black Friday sale is officially live. T...

3-Day & 7-Day Trial at $1.9

GPU Special Offers

RTX40 & P40 GPU Server

Light Server promotion:

ulhost

Cloud Server promotion:

Affordable CDN

ucdn

2025 Special Offers

annual vps

Copyright © 2024 SurferCloud All Rights Reserved. Terms of Service. Sitemap.