From: Peter Eisentraut Date: Mon, 8 Jan 2001 21:01:54 +0000 (+0000) Subject: Add rudimentary section about controlling kernel's file and process limits. X-Git-Tag: REL7_1_BETA3~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=005ad6cdd6507150246c12955c27ac2e995469ac;p=postgresql Add rudimentary section about controlling kernel's file and process limits. --- diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml index 1a86b5c9bb..81d0846e00 100644 --- a/doc/src/sgml/runtime.sgml +++ b/doc/src/sgml/runtime.sgml @@ -1,5 +1,5 @@ @@ -1536,7 +1536,8 @@ options "SEMMNU=120" - FreeBSD + FreeBSD + OpenBSD The options SYSVSHM and SYSVSEM need @@ -1545,14 +1546,14 @@ options "SEMMNU=120" the option SHMMAXPGS (in pages). The following shows an example of how to set the various parameters: -options SYSVSHM -options SHMMAXPGS=4096 -options SHMSEG=256 - -options SYSVSEM -options SEMMNI=256 -options SEMMNS=512 -options SEMMNU=256 +options SYSVSHM +options SHMMAXPGS=4096 +options SHMSEG=256 + +options SYSVSEM +options SEMMNI=256 +options SEMMNS=512 +options SEMMNU=256 options SEMMAP=256 @@ -1711,24 +1712,82 @@ set semsys:seminfo_semmsl=32 - - - If your platform is not listed here, please consider - contributing some information. - - - + + + Resource Limits + + + Unix-like operating systems enforce various kinds of resource + limits that might interfere with the operation of your + Postgres server. Of importance are + especially the limits on the number of processes per user, the + number of open files per process, and the amount of memory + available to a process. Each of these have a hard + and a soft limit. The soft limit is what actually + counts but it can be changed by the user up to the hard limit. + The hard limit can only be changed by the root user. The system + call setrlimit is responsible for setting + these parameters. The shell the built-in command + ulimit (Bourne shells) or + limit (csh) is used to control the resource + limits from the command line. On BSD-derived systems the file + /etc/login.conf controls what values the + various resource limits are set to upon login. See + login.conf + 5 for details. The relevant + parameters are maxproc, + openfiles, and datasize. + For example: + +default:\ +... + :datasize-cur=256M:\ + :maxproc-cur=256:\ + :openfiles-cur=256:\ +... + + (-cur is the soft limit. Append + -max to set the hard limit.) + + + + Kernels generally also have an implementation-dependent + system-wide limit on some resources. + + + On Linux + /proc/sys/fs/file-max determines the + maximum number of files that the kernel will allocate. It can + be changed by writing a different number into the file or by + adding an assignment in /etc/sysctl.conf. + The maximum limit of files per process is fixed at the time the + kernel is compiled; see + /usr/src/linux/Documentation/proc.txt for + more information. + + + + + + The Postgres server uses one process + per connection so you should provide for at least as many processes + as allowed connections, in addition to what you need for the rest + of your system. This is usually not a problem but if you run + several servers on one machine things might get tight. + + + + The factory default limit on open files is often set to + socially friendly values that allow many users to + coexist on a machine without using an inappropriate fraction of + the system resources. If you run many servers on a machine this + is perhaps what you want, but on dedicated servers you may want to + raise this limit. + + @@ -1819,19 +1878,18 @@ set semsys:seminfo_semmsl=32 can be started with the argument