Home Explore Blog CI



postgresql

35th chunk of `doc/src/sgml/config.sgml`
237374e26c9c0b61b8cfc2db83afd0c2698ef79d8355a5a40000000100000fa0
 which may be slower due
        to memory management overheads.  Memory that is allocated at startup
        with <varname>min_dynamic_shared_memory</varname> is affected by
        the <varname>huge_pages</varname> setting on operating systems where
        that is supported, and may be more likely to benefit from larger pages
        on operating systems where that is managed automatically.
        The default value is <literal>0</literal> (none). This parameter can
        only be set at server start.
       </para>
      </listitem>
     </varlistentry>

     </variablelist>
     </sect2>

     <sect2 id="runtime-config-resource-disk">
     <title>Disk</title>

     <variablelist>
     <varlistentry id="guc-temp-file-limit" xreflabel="temp_file_limit">
      <term><varname>temp_file_limit</varname> (<type>integer</type>)
      <indexterm>
       <primary><varname>temp_file_limit</varname> configuration parameter</primary>
      </indexterm>
      </term>
      <listitem>
       <para>
        Specifies the maximum amount of disk space that a process can use
        for temporary files, such as sort and hash temporary files, or the
        storage file for a held cursor.  A transaction attempting to exceed
        this limit will be canceled.
        If this value is specified without units, it is taken as kilobytes.
        <literal>-1</literal> (the default) means no limit.
        Only superusers and users with the appropriate <literal>SET</literal>
        privilege can change this setting.
       </para>
       <para>
        This setting constrains the total space used at any instant by all
        temporary files used by a given <productname>PostgreSQL</productname> process.
        It should be noted that disk space used for explicit temporary
        tables, as opposed to temporary files used behind-the-scenes in query
        execution, does <emphasis>not</emphasis> count against this limit.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry id="guc_file_copy_method" xreflabel="file_copy_method">
      <term><varname>file_copy_method</varname> (<type>enum</type>)
      <indexterm>
       <primary><varname>file_copy_method</varname> configuration parameter</primary>
      </indexterm>
      </term>
      <listitem>
       <para>
        Specifies the method used to copy files.
        Possible values are <literal>COPY</literal> (default) and
        <literal>CLONE</literal> (if operating support is available).
       </para>

       <para>
       This parameter affects:
       </para>
       <itemizedlist>
        <listitem>
        <para>
         <literal><command>CREATE DATABASE ... STRATEGY=FILE_COPY</command></literal>
        </para>
        </listitem>
        <listitem>
        <para>
         <command>ALTER DATABASE ... SET TABLESPACE ...</command>
        </para>
        </listitem>
       </itemizedlist>

       <para>
        <literal>CLONE</literal> uses the <function>copy_file_range()</function>
        (Linux, FreeBSD) or <function>copyfile</function>
        (macOS) system calls, giving the kernel the opportunity to share disk
        blocks or push work down to lower layers on some file systems.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry id="guc-max-notify-queue-pages" xreflabel="max_notify_queue_pages">
      <term><varname>max_notify_queue_pages</varname> (<type>integer</type>)
      <indexterm>
       <primary><varname>max_notify_queue_pages</varname> configuration parameter</primary>
      </indexterm>
      </term>
      <listitem>
       <para>
        Specifies the maximum amount of allocated pages for
        <xref linkend="sql-notify"/> / <xref linkend="sql-listen"/> queue.
        The default value is 1048576. For 8 KB pages it allows to consume
        up to 8 GB of disk space.
       </para>
      </listitem>
     </varlistentry>

     </variablelist>
     </sect2>

     <sect2 id="runtime-config-resource-kernel">
     <title>Kernel

Title: Configuration Parameters: Disk and Kernel Resource Limits (temp_file_limit, file_copy_method, max_notify_queue_pages)
Summary
This section describes parameters related to disk resource management. `temp_file_limit` sets the maximum disk space a process can use for temporary files, with -1 indicating no limit. Superusers and users with SET privilege can adjust this. `file_copy_method` specifies the method used to copy files (COPY or CLONE), affecting CREATE DATABASE and ALTER DATABASE operations, with CLONE potentially leveraging kernel-level optimizations. `max_notify_queue_pages` determines the maximum allocated pages for the NOTIFY/LISTEN queue (default 1048576, allowing up to 8GB disk usage with 8KB pages).