Upper limit on number of buffers?

Started by mlwabout 25 years ago8 messages
#1mlw
markw@mohawksoft.com

This line works:
/usr/local/pgsql/bin/postmaster -N 32 -B 928 -i -S
-D/home/postgres/pgdev -o "-F -fs -S 4096"

Where as this line:

/usr/local/pgsql/bin/postmaster -N 32 -B 1024 -i -S
-D/home/postgres/pgdev -o "-F -fs -S 4096"

does not.

Any ideas?
I have 256M of memory, RedHat Linux 7.0, CVS version of Postgres as of a
couple days ago.

--
http://www.mohawksoft.com

#2Alfred Perlstein
bright@wintelcom.net
In reply to: mlw (#1)
Re: Upper limit on number of buffers?

* mlw <markw@mohawksoft.com> [001224 18:06] wrote:

This line works:
/usr/local/pgsql/bin/postmaster -N 32 -B 928 -i -S
-D/home/postgres/pgdev -o "-F -fs -S 4096"

Where as this line:

/usr/local/pgsql/bin/postmaster -N 32 -B 1024 -i -S
-D/home/postgres/pgdev -o "-F -fs -S 4096"

does not.

Any ideas?
I have 256M of memory, RedHat Linux 7.0, CVS version of Postgres as of a
couple days ago.

Giving us the exact reason it "doesn't work" would be helpful, perhaps
the error message?

I'm just going to guess that you need to consult your OS's
documentation and figure out how to raise the amount of system V
shared memory available.

--
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
"I have the heart of a child; I keep it in a jar on my desk."

#3Joe Conway
jconway2@home.com
In reply to: mlw (#1)
Re: Upper limit on number of buffers?

* mlw <markw@mohawksoft.com> [001224 18:06] wrote:

This line works:
/usr/local/pgsql/bin/postmaster -N 32 -B 928 -i -S
-D/home/postgres/pgdev -o "-F -fs -S 4096"

Where as this line:

/usr/local/pgsql/bin/postmaster -N 32 -B 1024 -i -S
-D/home/postgres/pgdev -o "-F -fs -S 4096"

does not.

Any ideas?
I have 256M of memory, RedHat Linux 7.0, CVS version of Postgres as of a
couple days ago.

I'm just going to guess that you need to consult your OS's
documentation and figure out how to raise the amount of system V
shared memory available.

I think Alfred is probably correct. I've run into this before myself. See
the following link:

http://www.postgresql.org/devel-corner/docs/admin/kernel-resources.htm#SYSVI
PC

The relevant section reads:

Linux

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:

$ echo 134217728 >/proc/sys/kernel/shmall
$ echo 134217728 >/proc/sys/kernel/shmmax
You could put these commands into a script run at boot-time.

Other parameters are sufficiently sized for any application. If you want to
see for yourself look into /usr/src/linux/include/asm-xxx/shmparam.h and
/usr/src/linux/include/linux/sem.h.

Hope this helps,

Joe

#4Joe Conway
joe@conway-family.com
In reply to: Joe Conway (#3)
Re: Upper limit on number of buffers?

* mlw <markw@mohawksoft.com> [001224 18:06] wrote:

This line works:
/usr/local/pgsql/bin/postmaster -N 32 -B 928 -i -S
-D/home/postgres/pgdev -o "-F -fs -S 4096"

Where as this line:

/usr/local/pgsql/bin/postmaster -N 32 -B 1024 -i -S
-D/home/postgres/pgdev -o "-F -fs -S 4096"

does not.

Any ideas?
I have 256M of memory, RedHat Linux 7.0, CVS version of Postgres as of

a

couple days ago.

I'm just going to guess that you need to consult your OS's
documentation and figure out how to raise the amount of system V
shared memory available.

I think Alfred is probably correct. I've run into this before myself. See
the following link:

http://www.postgresql.org/devel-corner/docs/admin/kernel-resources.htm#SYSVI
PC

The relevant section reads:

Linux

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:

$ echo 134217728 >/proc/sys/kernel/shmall
$ echo 134217728 >/proc/sys/kernel/shmmax
You could put these commands into a script run at boot-time.

Other parameters are sufficiently sized for any application. If you want to
see for yourself look into /usr/src/linux/include/asm-xxx/shmparam.h and
/usr/src/linux/include/linux/sem.h.

Hope this helps,

Joe

#5Oleg Bartunov
oleg@sai.msu.su
In reply to: mlw (#1)
Re: Upper limit on number of buffers?

/proc/sys/kernel/shmmax

Oleg
On Sun, 24 Dec 2000, mlw wrote:

Date: Sun, 24 Dec 2000 13:52:43 -0500
From: mlw <markw@mohawksoft.com>
To: Hackers List <pgsql-hackers@postgresql.org>
Subject: [HACKERS] Upper limit on number of buffers?

This line works:
/usr/local/pgsql/bin/postmaster -N 32 -B 928 -i -S
-D/home/postgres/pgdev -o "-F -fs -S 4096"

Where as this line:

/usr/local/pgsql/bin/postmaster -N 32 -B 1024 -i -S
-D/home/postgres/pgdev -o "-F -fs -S 4096"

does not.

Any ideas?
I have 256M of memory, RedHat Linux 7.0, CVS version of Postgres as of a
couple days ago.

--
http://www.mohawksoft.com

_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83

#6mlw
markw@mohawksoft.com
In reply to: Oleg Bartunov (#5)
Re: Upper limit on number of buffers?

Oleg Bartunov wrote:

/proc/sys/kernel/shmmax

I think I am getting a lot of "Homer Simpson" awards this year. The
killer is that I have dealt with this problem on another project. Thanks
guys.

Oleg
On Sun, 24 Dec 2000, mlw wrote:

Date: Sun, 24 Dec 2000 13:52:43 -0500
From: mlw <markw@mohawksoft.com>
To: Hackers List <pgsql-hackers@postgresql.org>
Subject: [HACKERS] Upper limit on number of buffers?

This line works:
/usr/local/pgsql/bin/postmaster -N 32 -B 928 -i -S
-D/home/postgres/pgdev -o "-F -fs -S 4096"

Where as this line:

/usr/local/pgsql/bin/postmaster -N 32 -B 1024 -i -S
-D/home/postgres/pgdev -o "-F -fs -S 4096"

does not.

Any ideas?
I have 256M of memory, RedHat Linux 7.0, CVS version of Postgres as of a
couple days ago.

--
http://www.mohawksoft.com

_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83

--
http://www.mohawksoft.com

#7Michael J Schout
mschout@gkg.net
In reply to: Joe Conway (#4)
Re: Upper limit on number of buffers?

On Sun, 24 Dec 2000, Joe Conway wrote:

Linux

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:

$ echo 134217728 >/proc/sys/kernel/shmall
$ echo 134217728 >/proc/sys/kernel/shmmax
You could put these commands into a script run at boot-time.

On redhat 6.2 I know that you can use /etc/sysctl.conf to do this as well.

Just add this to /etc/sysctl.conf.

kernel.shmall = 134217728
kernel.shmmax = 134217728

After this, your tunables will be restored every time that the system boots.

Mike

#8Andrew McMillan
Andrew@catalyst.net.nz
In reply to: Michael J Schout (#7)
Re: Upper limit on number of buffers?

Michael J Schout wrote:

On Sun, 24 Dec 2000, Joe Conway wrote:

On redhat 6.2 I know that you can use /etc/sysctl.conf to do this as well.

Just add this to /etc/sysctl.conf.

kernel.shmall = 134217728
kernel.shmmax = 134217728

After this, your tunables will be restored every time that the system boots.

I can confirm that that applies under Debian as well, although there is
also some stuff in the startup script for Debian to configure files max
specifically for PostgreSQL.

Cheers,
Andrew.
--
_____________________________________________________________________
Andrew McMillan, e-mail: Andrew@catalyst.net.nz
Catalyst IT Ltd, PO Box 10-225, Level 22, 105 The Terrace, Wellington
Me: +64 (21) 635 694, Fax: +64 (4) 499 5596, Office: +64 (4) 499 2267