codekingpro/portable-devtools
115k
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>2<!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.3 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>3 Logical replication requires several configuration options to be set. Most4 options are relevant only on one side of the replication. However,5 <code class="varname">max_replication_slots</code> is used on both the publisher and6 the subscriber, but it has a different meaning for each.7 </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>8 <a class="link" href="runtime-config-wal.html#GUC-WAL-LEVEL"><code class="varname">wal_level</code></a> must be9 set to <code class="literal">logical</code>.10 </p><p>11 <a class="link" href="runtime-config-replication.html#GUC-MAX-REPLICATION-SLOTS"><code class="varname">max_replication_slots</code></a>12 must be set to at least the number of subscriptions expected to connect,13 plus some reserve for table synchronization.14 </p><p>15 <a class="link" href="runtime-config-replication.html#GUC-MAX-WAL-SENDERS"><code class="varname">max_wal_senders</code></a>16 should be set to at least the same as17 <code class="varname">max_replication_slots</code>, plus the number of physical18 replicas that are connected at the same time.19 </p><p>20 Logical replication walsender is also affected by21 <a class="link" href="runtime-config-replication.html#GUC-WAL-SENDER-TIMEOUT"><code class="varname">wal_sender_timeout</code></a>.22 </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>23 <a class="link" href="runtime-config-replication.html#GUC-MAX-REPLICATION-SLOTS-SUBSCRIBER"><code class="varname">max_replication_slots</code></a>24 must be set to at least the number of subscriptions that will be added to25 the subscriber, plus some reserve for table synchronization.26 </p><p>27 <a class="link" href="runtime-config-replication.html#GUC-MAX-LOGICAL-REPLICATION-WORKERS"><code class="varname">max_logical_replication_workers</code></a>28 must be set to at least the number of subscriptions (for leader apply29 workers), plus some reserve for the table synchronization workers and30 parallel apply workers.31 </p><p>32 <a class="link" href="runtime-config-resource.html#GUC-MAX-WORKER-PROCESSES"><code class="varname">max_worker_processes</code></a>33 may need to be adjusted to accommodate for replication workers, at least34 (<a class="link" href="runtime-config-replication.html#GUC-MAX-LOGICAL-REPLICATION-WORKERS"><code class="varname">max_logical_replication_workers</code></a>35 + <code class="literal">1</code>). Note, some extensions and parallel queries also36 take worker slots from <code class="varname">max_worker_processes</code>.37 </p><p>38 <a class="link" href="runtime-config-replication.html#GUC-MAX-SYNC-WORKERS-PER-SUBSCRIPTION"><code class="varname">max_sync_workers_per_subscription</code></a>39 controls the amount of parallelism of the initial data copy during the40 subscription initialization or when new tables are added.41 </p><p>42 <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>43 controls the amount of parallelism for streaming of in-progress44 transactions with subscription parameter45 <code class="literal">streaming = parallel</code>.46 </p><p>47 Logical replication workers are also affected by48 <a class="link" href="runtime-config-replication.html#GUC-WAL-RECEIVER-TIMEOUT"><code class="varname">wal_receiver_timeout</code></a>,49 <a class="link" href="runtime-config-replication.html#GUC-WAL-RECEIVER-STATUS-INTERVAL"><code class="varname">wal_receiver_status_interval</code></a> and50 <a class="link" href="runtime-config-replication.html#GUC-WAL-RETRIEVE-RETRY-INTERVAL"><code class="varname">wal_retrieve_retry_interval</code></a>.51 </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.3 Documentation">Home</a></td><td width="40%" align="right" valign="top"> 31.11. Quick Setup</td></tr></table></div></body></html>