summaryrefslogtreecommitdiffstats
path: root/doc/src/sgml/html/logical-replication-config.html
blob: 58381fc48750305e59e1c9d51a3252e2cf85f6c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>31.10. Configuration Settings</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="logical-replication-security.html" title="31.9. Security" /><link rel="next" href="logical-replication-quick-setup.html" title="31.11. Quick Setup" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">31.10. Configuration Settings</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="logical-replication-security.html" title="31.9. Security">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="logical-replication.html" title="Chapter 31. Logical Replication">Up</a></td><th width="60%" align="center">Chapter 31. Logical Replication</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 16.2 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="logical-replication-quick-setup.html" title="31.11. Quick Setup">Next</a></td></tr></table><hr /></div><div class="sect1" id="LOGICAL-REPLICATION-CONFIG"><div class="titlepage"><div><div><h2 class="title" style="clear: both">31.10. Configuration Settings <a href="#LOGICAL-REPLICATION-CONFIG" class="id_link">#</a></h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="sect2"><a href="logical-replication-config.html#LOGICAL-REPLICATION-CONFIG-PUBLISHER">31.10.1. Publishers</a></span></dt><dt><span class="sect2"><a href="logical-replication-config.html#LOGICAL-REPLICATION-CONFIG-SUBSCRIBER">31.10.2. Subscribers</a></span></dt></dl></div><p>
   Logical replication requires several configuration options to be set. Most
   options are relevant only on one side of the replication. However,
   <code class="varname">max_replication_slots</code> is used on both the publisher and
   the subscriber, but it has a different meaning for each.
  </p><div class="sect2" id="LOGICAL-REPLICATION-CONFIG-PUBLISHER"><div class="titlepage"><div><div><h3 class="title">31.10.1. Publishers <a href="#LOGICAL-REPLICATION-CONFIG-PUBLISHER" class="id_link">#</a></h3></div></div></div><p>
    <a class="link" href="runtime-config-wal.html#GUC-WAL-LEVEL"><code class="varname">wal_level</code></a> must be
    set to <code class="literal">logical</code>.
   </p><p>
    <a class="link" href="runtime-config-replication.html#GUC-MAX-REPLICATION-SLOTS"><code class="varname">max_replication_slots</code></a>
    must be set to at least the number of subscriptions expected to connect,
    plus some reserve for table synchronization.
   </p><p>
    <a class="link" href="runtime-config-replication.html#GUC-MAX-WAL-SENDERS"><code class="varname">max_wal_senders</code></a>
    should be set to at least the same as
    <code class="varname">max_replication_slots</code>, plus the number of physical
    replicas that are connected at the same time.
   </p><p>
    Logical replication walsender is also affected by
    <a class="link" href="runtime-config-replication.html#GUC-WAL-SENDER-TIMEOUT"><code class="varname">wal_sender_timeout</code></a>.
   </p></div><div class="sect2" id="LOGICAL-REPLICATION-CONFIG-SUBSCRIBER"><div class="titlepage"><div><div><h3 class="title">31.10.2. Subscribers <a href="#LOGICAL-REPLICATION-CONFIG-SUBSCRIBER" class="id_link">#</a></h3></div></div></div><p>
    <a class="link" href="runtime-config-replication.html#GUC-MAX-REPLICATION-SLOTS-SUBSCRIBER"><code class="varname">max_replication_slots</code></a>
    must be set to at least the number of subscriptions that will be added to
    the subscriber, plus some reserve for table synchronization.
   </p><p>
    <a class="link" href="runtime-config-replication.html#GUC-MAX-LOGICAL-REPLICATION-WORKERS"><code class="varname">max_logical_replication_workers</code></a>
    must be set to at least the number of subscriptions (for leader apply
    workers), plus some reserve for the table synchronization workers and
    parallel apply workers.
   </p><p>
    <a class="link" href="runtime-config-resource.html#GUC-MAX-WORKER-PROCESSES"><code class="varname">max_worker_processes</code></a>
    may need to be adjusted to accommodate for replication workers, at least
    (<a class="link" href="runtime-config-replication.html#GUC-MAX-LOGICAL-REPLICATION-WORKERS"><code class="varname">max_logical_replication_workers</code></a>
    + <code class="literal">1</code>). Note, some extensions and parallel queries also
    take worker slots from <code class="varname">max_worker_processes</code>.
   </p><p>
    <a class="link" href="runtime-config-replication.html#GUC-MAX-SYNC-WORKERS-PER-SUBSCRIPTION"><code class="varname">max_sync_workers_per_subscription</code></a>
     controls the amount of parallelism of the initial data copy during the
     subscription initialization or when new tables are added.
   </p><p>
    <a class="link" href="runtime-config-replication.html#GUC-MAX-PARALLEL-APPLY-WORKERS-PER-SUBSCRIPTION"><code class="varname">max_parallel_apply_workers_per_subscription</code></a>
     controls the amount of parallelism for streaming of in-progress
     transactions with subscription parameter
     <code class="literal">streaming = parallel</code>.
   </p><p>
    Logical replication workers are also affected by
    <a class="link" href="runtime-config-replication.html#GUC-WAL-RECEIVER-TIMEOUT"><code class="varname">wal_receiver_timeout</code></a>,
    <a class="link" href="runtime-config-replication.html#GUC-WAL-RECEIVER-STATUS-INTERVAL"><code class="varname">wal_receiver_status_interval</code></a> and
    <a class="link" href="runtime-config-replication.html#GUC-WAL-RETRIEVE-RETRY-INTERVAL"><code class="varname">wal_retrieve_retry_interval</code></a>.
   </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="logical-replication-security.html" title="31.9. Security">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="logical-replication.html" title="Chapter 31. Logical Replication">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="logical-replication-quick-setup.html" title="31.11. Quick Setup">Next</a></td></tr><tr><td width="40%" align="left" valign="top">31.9. Security </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 16.2 Documentation">Home</a></td><td width="40%" align="right" valign="top"> 31.11. Quick Setup</td></tr></table></div></body></html>