From be61fe032a2b8ac3b6130c1f7a38c918d9423ec8 Mon Sep 17 00:00:00 2001 From: Thomas Munro Date: Sat, 6 Jun 2020 15:20:14 +1200 Subject: [PATCH] doc: Clean up references to obsolete OS versions. Modernize the documentation to remove insecure and/or obsolete instructions about old operating systems. --- doc/src/sgml/runtime.sgml | 152 +++++--------------------------------- 1 file changed, 19 insertions(+), 133 deletions(-) diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml index a8bb85e6f5..c0d1860bf2 100644 --- a/doc/src/sgml/runtime.sgml +++ b/doc/src/sgml/runtime.sgml @@ -872,7 +872,7 @@ psql: could not connect to server: No such file or directory - At least as of version 5.1, it should not be necessary to do + It should not be necessary to do any special configuration for such parameters as SHMMAX, as it appears this is configured to allow all memory to be used as shared memory. That is the @@ -907,41 +907,24 @@ psql: could not connect to server: No such file or directory /etc/sysctl.conf. - - These semaphore-related settings are read-only as far as - sysctl is concerned, but can be set in - /boot/loader.conf: - -kern.ipc.semmni=256 -kern.ipc.semmns=512 - - After modifying that file, a reboot is required for the new - settings to take effect. - - - - You might also want to configure your kernel to lock System V shared + + If you have set shared_memory_type to + sysv (not the default, see ), + you might also want to configure your kernel to lock System V shared memory into RAM and prevent it from being paged out to swap. This can be accomplished using the sysctl setting kern.ipc.shm_use_phys. - If running in FreeBSD jails by enabling sysctl's - security.jail.sysvipc_allowed, postmasters - running in different jails should be run by different operating system - users. This improves security because it prevents non-root users - from interfering with shared memory or semaphores in different jails, - and it allows the PostgreSQL IPC cleanup code to function properly. - (In FreeBSD 6.0 and later the IPC cleanup code does not properly detect - processes in other jails, preventing the running of postmasters on the - same port in different jails.) + If running in a FreeBSD jail, you should set its + sysvshm parameter to new, so that + it has its own separate System V shared memory namespace. + (Before FreeBSD 11.0, it was necessary to enable shared access to + the host's IPC namespace from jails, and take measures to avoid + collisions.) - - FreeBSD versions before 4.0 work like - old OpenBSD (see below). - @@ -974,13 +957,6 @@ kern.ipc.semmns=512 This can be accomplished using the sysctl setting kern.ipc.shm_use_phys. - - - NetBSD versions before 5.0 - work like old OpenBSD - (see below), except that kernel parameters should be set with the - keyword options not option. - @@ -990,7 +966,7 @@ kern.ipc.semmns=512 - In OpenBSD 3.3 and later, + In OpenBSD, IPC parameters can be adjusted using sysctl, for example: @@ -1008,25 +984,6 @@ kern.ipc.semmns=512 for these are uncomfortably small. - - In older OpenBSD versions, - you will need to build a custom kernel to change the IPC parameters. - Make sure that the options SYSVSHM - and SYSVSEM are enabled, too. (They are by - default.) The following shows an example of how to set the various - parameters in the kernel configuration file: - -option SYSVSHM -option SHMMAXPGS=4096 -option SHMSEG=256 - -option SYSVSEM -option SEMMNI=256 -option SEMMNS=512 -option SEMMNU=256 - - - @@ -1037,9 +994,6 @@ option SEMMNU=256 The default settings tend to suffice for normal installations. - On HP-UX 10, the factory default for - SEMMNS is 128, which might be too low for larger - database sites. IPC parameters can be set in the System @@ -1078,9 +1032,7 @@ option SEMMNU=256 - Ancient distributions might not have the sysctl program, - but equivalent changes can be made by manipulating the - /proc file system: + Alternatively, the /proc file system can be used: $ echo 17179869184 >/proc/sys/kernel/shmmax $ echo 4194304 >/proc/sys/kernel/shmall @@ -1134,65 +1086,15 @@ kern.sysv.shmall=1024 kept across reboots. - - The file /etc/sysctl.conf is only honored in macOS - 10.3.9 and later. If you are running a previous 10.3.x release, - you must edit the file /etc/rc - and change the values in the following commands: - -sysctl -w kern.sysv.shmmax -sysctl -w kern.sysv.shmmin -sysctl -w kern.sysv.shmmni -sysctl -w kern.sysv.shmseg -sysctl -w kern.sysv.shmall - - Note that - /etc/rc is usually overwritten by macOS system updates, - so you should expect to have to redo these edits after each update. - - - - In macOS 10.2 and earlier, instead edit these commands in the file - /System/Library/StartupItems/SystemTuning/SystemTuning. - - - - - - - Solaris 2.6 to 2.9 (Solaris - 6 to Solaris 9) - SolarisIPC configuration - - - - The relevant settings can be changed in - /etc/system, for example: - -set shmsys:shminfo_shmmax=0x2000000 -set shmsys:shminfo_shmmin=1 -set shmsys:shminfo_shmmni=256 -set shmsys:shminfo_shmseg=256 - -set semsys:seminfo_semmap=256 -set semsys:seminfo_semmni=512 -set semsys:seminfo_semmns=512 -set semsys:seminfo_semmsl=32 - - You need to reboot for the changes to take effect. See also - - for information on shared memory under older versions of Solaris. - - Solaris 2.10 (Solaris - 10) and later - OpenSolaris + Solaris + illumos - In Solaris 10 and later, and OpenSolaris, the default shared memory and + In Solaris 10 and later, and illumos, the default shared memory and semaphore settings are good enough for most PostgreSQL applications. Solaris now defaults to a SHMMAX of one-quarter of system RAM. @@ -1415,7 +1317,7 @@ default:\ - In Linux 2.4 and later, the default virtual memory behavior is not + The default virtual memory behavior is not optimal for PostgreSQL. Because of the way that the kernel implements memory overcommit, the kernel might terminate the PostgreSQL postmaster (the @@ -1462,7 +1364,7 @@ Out of Memory: Killed process 12345 (postgres). - On Linux 2.6 and later, it is possible to modify the + It is possible to modify the kernel's behavior so that it will not overcommit memory. Although this setting will not prevent the OOM killer from being invoked @@ -1508,28 +1410,12 @@ export PG_OOM_ADJUST_VALUE=0 - Older Linux kernels do not offer /proc/self/oom_score_adj, + Very old Linux kernels do not offer /proc/self/oom_score_adj, but may have a previous version of the same functionality called /proc/self/oom_adj. This works the same except the disable value is -17 not -1000. - - - Some vendors' Linux 2.4 kernels are reported to have early versions - of the 2.6 overcommit sysctl parameter. However, setting - vm.overcommit_memory to 2 - on a 2.4 kernel that does not have the relevant code will make - things worse, not better. It is recommended that you inspect - the actual kernel source code (see the function - vm_enough_memory in the file mm/mmap.c) - to verify what is supported in your kernel before you try this in a 2.4 - installation. The presence of the overcommit-accounting - documentation file should not be taken as evidence that the - feature is there. If in any doubt, consult a kernel expert or your - kernel vendor. - - -- 2.20.1