pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feedInstructions for Linux ipc config
6+ messages / 3 participants
[nested] [flat]
* Instructions for Linux ipc config
@ 2005-02-03 23:06 Mark Kirkwood <markir@coretech.co.nz>
2005-02-03 23:18 ` Re: Instructions for Linux ipc config Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 6+ messages in thread
From: Mark Kirkwood @ 2005-02-03 23:06 UTC (permalink / raw)
To: pgsql-docs
Glancing over these as I was doing the FreeBSD patch, I noticed some
scope for modernization there plus a possible error to correct:
i) we could standardize the change method to use sysctl instead of
echo'ing things into /proc/kernel/* structures (unless there is some
reason for this to be preferable?)
ii) we are recommending setting kernel.shmall equal to kernel.shmmax. I
think this is incorrect or strange anyway :
examining 2.6.10 src I see
./include/linux/shm.h:16: #define SHMALL (SHMMAX/PAGE_SIZE*(SHMMNI/16))
/* max shm system wide (pages) */
i.e. kernel.shmall really is in pages. So our suggested settings of:
kernel.shmall = 134217728
kernel.shmmax = 134217728
allow PAGE_SIZE 128M segments to be created... thats 4096 of 'em on
most common HW. This is probably more than most systems would need or
want (and does setting this value too high have a performance impact?).
One option is to follow what we have said for the BSD's i.e:
kernel.shmall = 32768
or leave shmall at its default (commonly 2097152).
What do people think?
regards
Mark
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Instructions for Linux ipc config
2005-02-03 23:06 Instructions for Linux ipc config Mark Kirkwood <markir@coretech.co.nz>
@ 2005-02-03 23:18 ` Tom Lane <tgl@sss.pgh.pa.us>
2005-02-04 01:18 ` Re: Instructions for Linux ipc config Mark Kirkwood <markir@coretech.co.nz>
0 siblings, 1 reply; 6+ messages in thread
From: Tom Lane @ 2005-02-03 23:18 UTC (permalink / raw)
To: Mark Kirkwood <markir@coretech.co.nz>; +Cc: pgsql-docs
Mark Kirkwood <markir@coretech.co.nz> writes:
> Glancing over these as I was doing the FreeBSD patch, I noticed some
> scope for modernization there plus a possible error to correct:
> i) we could standardize the change method to use sysctl instead of
> echo'ing things into /proc/kernel/* structures (unless there is some
> reason for this to be preferable?)
How far back in Linux history does that work? It would be bad to remove
instructions needed for versions that people are still using. But yeah,
if we can standardize on describing sysctl that's probably a good thing,
since it applies to more than one platform.
> ii) we are recommending setting kernel.shmall equal to kernel.shmmax. I
> think this is incorrect or strange anyway :
It does make sense for shmall-in-bytes to exceed shmmax-in-bytes, but
probably not by a factor of 4000 ...
regards, tom lane
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Instructions for Linux ipc config
2005-02-03 23:06 Instructions for Linux ipc config Mark Kirkwood <markir@coretech.co.nz>
2005-02-03 23:18 ` Re: Instructions for Linux ipc config Tom Lane <tgl@sss.pgh.pa.us>
@ 2005-02-04 01:18 ` Mark Kirkwood <markir@coretech.co.nz>
2005-02-04 21:07 ` Re: Instructions for Linux ipc config Mark Kirkwood <markir@coretech.co.nz>
0 siblings, 1 reply; 6+ messages in thread
From: Mark Kirkwood @ 2005-02-04 01:18 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-docs
Tom Lane wrote:
> Mark Kirkwood <markir@coretech.co.nz> writes:
>
>>Glancing over these as I was doing the FreeBSD patch, I noticed some
>>scope for modernization there plus a possible error to correct:
>
>
>>i) we could standardize the change method to use sysctl instead of
>>echo'ing things into /proc/kernel/* structures (unless there is some
>>reason for this to be preferable?)
>
>
> How far back in Linux history does that work? It would be bad to remove
> instructions needed for versions that people are still using. But yeah,
> if we can standardize on describing sysctl that's probably a good thing,
> since it applies to more than one platform.
>
>
Interesting question (goes away to look at old linux distros...). Some
quite old ones have a sysctl binary - e.g. Redhat 6.2 / linux 2.2.14.
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.
regards
Mark
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Instructions for Linux ipc config
2005-02-03 23:06 Instructions for Linux ipc config Mark Kirkwood <markir@coretech.co.nz>
2005-02-03 23:18 ` Re: Instructions for Linux ipc config Tom Lane <tgl@sss.pgh.pa.us>
2005-02-04 01:18 ` Re: Instructions for Linux ipc config Mark Kirkwood <markir@coretech.co.nz>
@ 2005-02-04 21:07 ` Mark Kirkwood <markir@coretech.co.nz>
2005-02-15 04:16 ` Re: Instructions for Linux ipc config Bruce Momjian <pgman@candle.pha.pa.us>
2005-02-26 23:19 ` Re: Instructions for Linux ipc config Bruce Momjian <pgman@candle.pha.pa.us>
0 siblings, 2 replies; 6+ messages in thread
From: Mark Kirkwood @ 2005-02-04 21:07 UTC (permalink / raw)
To: pgsql-docs; +Cc: Tom Lane <tgl@sss.pgh.pa.us>
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.
>
Attachments:
runtime.sgml.diff (text/plain, 2.7K) download
--- runtime.sgml.orig Fri Feb 4 22:17:45 2005
+++ runtime.sgml Fri Feb 4 22:17:57 2005
@@ -4414,37 +4414,29 @@
<indexterm><primary>Linux</><secondary>IPC configuration</></>
<listitem>
<para>
- The default shared memory limit (both
- <varname>SHMMAX</varname> and <varname>SHMALL</varname>) is 32
- MB in 2.2 kernels, but it can be changed in the
- <filename>proc</filename> 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
+ <command>sysctl</command> interface. For example, to allow 128 MB,
+ and explicitly set the maximum total shared memory size to 2097152
+ pages (the default):
<screen>
-<prompt>$</prompt> <userinput>echo 134217728 >/proc/sys/kernel/shmall</userinput>
-<prompt>$</prompt> <userinput>echo 134217728 >/proc/sys/kernel/shmmax</userinput>
+<prompt>$</prompt> <userinput>systcl -w kernel.shmmax=134217728</userinput>
+<prompt>$</prompt> <userinput>systcl -w kernel.shmall=2097152</userinput>
</screen>
- You could put these commands into a script run at boot-time.
- </para>
-
- <para>
- Alternatively, you can use <command>sysctl</command>, if
- available, to control these parameters. Look for a file
- called <filename>/etc/sysctl.conf</filename> and add lines
- like the following to it:
-<programlisting>
-kernel.shmall = 134217728
-kernel.shmmax = 134217728
-</programlisting>
- This file is usually processed at boot time, but
- <command>sysctl</command> can also be called
- explicitly later.
+ In addition these settings can be saved between reboots in
+ <filename>/etc/sysctl.conf.
</para>
<para>
- Other parameters are sufficiently sized for any application. If
- you want to see for yourself look in
- <filename>/usr/src/linux/include/asm-<replaceable>xxx</>/shmparam.h</>
- and <filename>/usr/src/linux/include/linux/sem.h</>.
+ Older distributions may not have the <command>sysctl</command> program,
+ but equivalent changes can be made by manipulating the
+ <filename>/proc</filename> filesystem:
+<screen>
+<prompt>$</prompt> <userinput>echo 134217728 >/proc/sys/kernel/shmmax</userinput>
+<prompt>$</prompt> <userinput>echo 2097152 >/proc/sys/kernel/shmall</userinput>
+</screen>
</para>
</listitem>
</varlistentry>
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Instructions for Linux ipc config
2005-02-03 23:06 Instructions for Linux ipc config Mark Kirkwood <markir@coretech.co.nz>
2005-02-03 23:18 ` Re: Instructions for Linux ipc config Tom Lane <tgl@sss.pgh.pa.us>
2005-02-04 01:18 ` Re: Instructions for Linux ipc config Mark Kirkwood <markir@coretech.co.nz>
2005-02-04 21:07 ` Re: Instructions for Linux ipc config Mark Kirkwood <markir@coretech.co.nz>
@ 2005-02-15 04:16 ` Bruce Momjian <pgman@candle.pha.pa.us>
1 sibling, 0 replies; 6+ messages in thread
From: Bruce Momjian @ 2005-02-15 04:16 UTC (permalink / raw)
To: Mark Kirkwood <markir@coretech.co.nz>; +Cc: pgsql-docs@postgresql.org, Tom Lane <tgl@sss.pgh.pa.us>
Your patch has been added to the PostgreSQL unapplied patches list at:
http://momjian.postgresql.org/cgi-bin/pgpatches
It will be applied as soon as one of the PostgreSQL committers reviews
and approves it.
---------------------------------------------------------------------------
Mark Kirkwood wrote:
> 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.
> >
>
>
> --- runtime.sgml.orig Fri Feb 4 22:17:45 2005
> +++ runtime.sgml Fri Feb 4 22:17:57 2005
> @@ -4414,37 +4414,29 @@
> <indexterm><primary>Linux</><secondary>IPC configuration</></>
> <listitem>
> <para>
> - The default shared memory limit (both
> - <varname>SHMMAX</varname> and <varname>SHMALL</varname>) is 32
> - MB in 2.2 kernels, but it can be changed in the
> - <filename>proc</filename> 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
> + <command>sysctl</command> interface. For example, to allow 128 MB,
> + and explicitly set the maximum total shared memory size to 2097152
> + pages (the default):
> <screen>
> -<prompt>$</prompt> <userinput>echo 134217728 >/proc/sys/kernel/shmall</userinput>
> -<prompt>$</prompt> <userinput>echo 134217728 >/proc/sys/kernel/shmmax</userinput>
> +<prompt>$</prompt> <userinput>systcl -w kernel.shmmax=134217728</userinput>
> +<prompt>$</prompt> <userinput>systcl -w kernel.shmall=2097152</userinput>
> </screen>
> - You could put these commands into a script run at boot-time.
> - </para>
> -
> - <para>
> - Alternatively, you can use <command>sysctl</command>, if
> - available, to control these parameters. Look for a file
> - called <filename>/etc/sysctl.conf</filename> and add lines
> - like the following to it:
> -<programlisting>
> -kernel.shmall = 134217728
> -kernel.shmmax = 134217728
> -</programlisting>
> - This file is usually processed at boot time, but
> - <command>sysctl</command> can also be called
> - explicitly later.
> + In addition these settings can be saved between reboots in
> + <filename>/etc/sysctl.conf.
> </para>
>
> <para>
> - Other parameters are sufficiently sized for any application. If
> - you want to see for yourself look in
> - <filename>/usr/src/linux/include/asm-<replaceable>xxx</>/shmparam.h</>
> - and <filename>/usr/src/linux/include/linux/sem.h</>.
> + Older distributions may not have the <command>sysctl</command> program,
> + but equivalent changes can be made by manipulating the
> + <filename>/proc</filename> filesystem:
> +<screen>
> +<prompt>$</prompt> <userinput>echo 134217728 >/proc/sys/kernel/shmmax</userinput>
> +<prompt>$</prompt> <userinput>echo 2097152 >/proc/sys/kernel/shmall</userinput>
> +</screen>
> </para>
> </listitem>
> </varlistentry>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Instructions for Linux ipc config
2005-02-03 23:06 Instructions for Linux ipc config Mark Kirkwood <markir@coretech.co.nz>
2005-02-03 23:18 ` Re: Instructions for Linux ipc config Tom Lane <tgl@sss.pgh.pa.us>
2005-02-04 01:18 ` Re: Instructions for Linux ipc config Mark Kirkwood <markir@coretech.co.nz>
2005-02-04 21:07 ` Re: Instructions for Linux ipc config Mark Kirkwood <markir@coretech.co.nz>
@ 2005-02-26 23:19 ` Bruce Momjian <pgman@candle.pha.pa.us>
1 sibling, 0 replies; 6+ messages in thread
From: Bruce Momjian @ 2005-02-26 23:19 UTC (permalink / raw)
To: Mark Kirkwood <markir@coretech.co.nz>; +Cc: pgsql-docs@postgresql.org, Tom Lane <tgl@sss.pgh.pa.us>
Patch applied. Thanks.
---------------------------------------------------------------------------
Mark Kirkwood wrote:
> 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.
> >
>
>
> --- runtime.sgml.orig Fri Feb 4 22:17:45 2005
> +++ runtime.sgml Fri Feb 4 22:17:57 2005
> @@ -4414,37 +4414,29 @@
> <indexterm><primary>Linux</><secondary>IPC configuration</></>
> <listitem>
> <para>
> - The default shared memory limit (both
> - <varname>SHMMAX</varname> and <varname>SHMALL</varname>) is 32
> - MB in 2.2 kernels, but it can be changed in the
> - <filename>proc</filename> 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
> + <command>sysctl</command> interface. For example, to allow 128 MB,
> + and explicitly set the maximum total shared memory size to 2097152
> + pages (the default):
> <screen>
> -<prompt>$</prompt> <userinput>echo 134217728 >/proc/sys/kernel/shmall</userinput>
> -<prompt>$</prompt> <userinput>echo 134217728 >/proc/sys/kernel/shmmax</userinput>
> +<prompt>$</prompt> <userinput>systcl -w kernel.shmmax=134217728</userinput>
> +<prompt>$</prompt> <userinput>systcl -w kernel.shmall=2097152</userinput>
> </screen>
> - You could put these commands into a script run at boot-time.
> - </para>
> -
> - <para>
> - Alternatively, you can use <command>sysctl</command>, if
> - available, to control these parameters. Look for a file
> - called <filename>/etc/sysctl.conf</filename> and add lines
> - like the following to it:
> -<programlisting>
> -kernel.shmall = 134217728
> -kernel.shmmax = 134217728
> -</programlisting>
> - This file is usually processed at boot time, but
> - <command>sysctl</command> can also be called
> - explicitly later.
> + In addition these settings can be saved between reboots in
> + <filename>/etc/sysctl.conf.
> </para>
>
> <para>
> - Other parameters are sufficiently sized for any application. If
> - you want to see for yourself look in
> - <filename>/usr/src/linux/include/asm-<replaceable>xxx</>/shmparam.h</>
> - and <filename>/usr/src/linux/include/linux/sem.h</>.
> + Older distributions may not have the <command>sysctl</command> program,
> + but equivalent changes can be made by manipulating the
> + <filename>/proc</filename> filesystem:
> +<screen>
> +<prompt>$</prompt> <userinput>echo 134217728 >/proc/sys/kernel/shmmax</userinput>
> +<prompt>$</prompt> <userinput>echo 2097152 >/proc/sys/kernel/shmall</userinput>
> +</screen>
> </para>
> </listitem>
> </varlistentry>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2005-02-26 23:19 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-02-03 23:06 Instructions for Linux ipc config Mark Kirkwood <markir@coretech.co.nz>
2005-02-03 23:18 ` Tom Lane <tgl@sss.pgh.pa.us>
2005-02-04 01:18 ` Mark Kirkwood <markir@coretech.co.nz>
2005-02-04 21:07 ` Mark Kirkwood <markir@coretech.co.nz>
2005-02-15 04:16 ` Bruce Momjian <pgman@candle.pha.pa.us>
2005-02-26 23:19 ` Bruce Momjian <pgman@candle.pha.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox