aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2022-08-23 09:41:37 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2022-08-23 09:42:02 -0400
commiteb0097c6f3eeb559e33369066be7279f540d05db (patch)
treed48e224451a403eaca6c4472ceeab74748028342
parent6d05d575bec5ef9a05f8d62f1c872b71dde32a01 (diff)
downloadpostgresql-eb0097c6f3eeb559e33369066be7279f540d05db.tar.gz
postgresql-eb0097c6f3eeb559e33369066be7279f540d05db.zip
Doc: prefer sysctl to /proc/sys in docs and comments.
sysctl is more portable than Linux's /proc/sys file tree, and often easier to use too. That's why most of our docs refer to sysctl when talking about how to adjust kernel parameters. Bring the few stragglers into line. Discussion: https://postgr.es/m/361175.1661187463@sss.pgh.pa.us
-rw-r--r--doc/src/sgml/runtime.sgml11
-rw-r--r--src/backend/postmaster/postmaster.c2
2 files changed, 7 insertions, 6 deletions
diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml
index 375644059db..5b3551c0847 100644
--- a/doc/src/sgml/runtime.sgml
+++ b/doc/src/sgml/runtime.sgml
@@ -1277,11 +1277,12 @@ default:\
<itemizedlist>
<listitem>
<para>
- On <productname>Linux</productname>
- <filename>/proc/sys/fs/file-max</filename> determines the
- maximum number of open files that the kernel will support. It can
- be changed by writing a different number into the file or by
- adding an assignment in <filename>/etc/sysctl.conf</filename>.
+ On <productname>Linux</productname> the kernel parameter
+ <varname>fs.file-max</varname> determines the maximum number of open
+ files that the kernel will support. It can be changed with
+ <literal>sysctl -w fs.file-max=<replaceable>N</replaceable></literal>.
+ To make the setting persist across reboots, add an assignment
+ in <filename>/etc/sysctl.conf</filename>.
The maximum limit of files per process is fixed at the time the
kernel is compiled; see
<filename>/usr/src/linux/Documentation/proc.txt</filename> for
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index ad35340a52d..db091b92786 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -4944,7 +4944,7 @@ SubPostmasterMain(int argc, char *argv[])
* If testing EXEC_BACKEND on Linux, you should run this as root before
* starting the postmaster:
*
- * echo 0 >/proc/sys/kernel/randomize_va_space
+ * sysctl -w kernel.randomize_va_space=0
*
* This prevents using randomized stack and code addresses that cause the
* child process's memory map to be different from the parent's, making it