X-Original-To: pgsql-docs-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 850088B9E7F for ; Fri, 4 Feb 2005 21:04:07 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 46684-08 for ; Fri, 4 Feb 2005 21:03:56 +0000 (GMT) Received: from mail.coretech.co.nz (coretech.co.nz [202.36.204.41]) by svr1.postgresql.org (Postfix) with ESMTP id 8C5768B9E65 for ; Fri, 4 Feb 2005 21:03:56 +0000 (GMT) Received: (qmail 20925 invoked from network); 4 Feb 2005 21:03:54 -0000 Received: from 218-101-14-25.paradise.net.nz (HELO ?192.168.1.11?) (218.101.14.25) by 0 with SMTP; 4 Feb 2005 21:03:54 -0000 Message-ID: <4203E428.10302@coretech.co.nz> Date: Sat, 05 Feb 2005 10:07:52 +1300 From: Mark Kirkwood User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.2) Gecko/20041016 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-docs@postgresql.org Cc: Tom Lane Subject: Re: Instructions for Linux ipc config References: <4202AE60.6000706@coretech.co.nz> <5980.1107472704@sss.pgh.pa.us> <4202CD6B.3050203@coretech.co.nz> In-Reply-To: <4202CD6B.3050203@coretech.co.nz> Content-Type: multipart/mixed; boundary="------------090505010403010308020004" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.194 tagged_above=0 required=5 tests=AWL, SEE_FOR_YOURSELF X-Spam-Level: X-Archive-Number: 200502/18 X-Sequence-Number: 2851 This is a multi-part message in MIME format. --------------090505010403010308020004 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Attached are my first thoughts for the amended instructions. Mark Kirkwood wrote: > > But to be on the safe side, it would make sense to do something similar > to the BSD section, and comment about older distributions maybe needing > to manipulate /proc/kernel/* directly. > --------------090505010403010308020004 Content-Type: text/plain; name="runtime.sgml.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="runtime.sgml.diff" --- runtime.sgml.orig Fri Feb 4 22:17:45 2005 +++ runtime.sgml Fri Feb 4 22:17:57 2005 @@ -4414,37 +4414,29 @@ LinuxIPC configuration - The default shared memory limit (both - SHMMAX and SHMALL) is 32 - MB in 2.2 kernels, but it can be changed in the - proc file system (without reboot). For - example, to allow 128 MB: + The default settings are only suitable for small installations + (the default max segment size is 32 MB). However the remaining + defaults are quite generously sized, and usually do not require + changes. The max segment size can be changed via the + sysctl interface. For example, to allow 128 MB, + and explicitly set the maximum total shared memory size to 2097152 + pages (the default): -$ echo 134217728 >/proc/sys/kernel/shmall -$ echo 134217728 >/proc/sys/kernel/shmmax +$ systcl -w kernel.shmmax=134217728 +$ systcl -w kernel.shmall=2097152 - You could put these commands into a script run at boot-time. - - - - Alternatively, you can use sysctl, if - available, to control these parameters. Look for a file - called /etc/sysctl.conf and add lines - like the following to it: - -kernel.shmall = 134217728 -kernel.shmmax = 134217728 - - This file is usually processed at boot time, but - sysctl can also be called - explicitly later. + In addition these settings can be saved between reboots in + /etc/sysctl.conf. - Other parameters are sufficiently sized for any application. If - you want to see for yourself look in - /usr/src/linux/include/asm-xxx/shmparam.h - and /usr/src/linux/include/linux/sem.h. + Older distributions may not have the sysctl program, + but equivalent changes can be made by manipulating the + /proc filesystem: + +$ echo 134217728 >/proc/sys/kernel/shmmax +$ echo 2097152 >/proc/sys/kernel/shmall + --------------090505010403010308020004--