Re: [GENERAL] Database in RAM

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Ed Loehr <eloehr(at)austin(dot)rr(dot)com>
Cc: PostgreSQL-documentation <pgsql-docs(at)postgresql(dot)org>
Subject: Re: [GENERAL] Database in RAM
Date: 2001-05-03 23:07:01
Message-ID: 200105032307.f43N71O07138@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

> > http://candle.pha.pa.us/main/writings/pgsql/performance/index.html
> >
> > It talks about memory usage and performance.
>
>
> Bruce, this is a very helpful and informative article. Thanks!

Thanks.


> BTW, this command had no effect on my redhat 6.2 system (1GB RAM):
>
> # whoami
> root
> # uname -a
> Linux bingo 2.2.12-20smp #1 SMP Mon Sep 27 10:34:45 EDT 1999 i686 unknown
> # cat /proc/sys/kernel/shmall
> 4194304
> # echo 134217728 > /proc/sys/kernel/shmall
> # cat /proc/sys/kernel/shmall
> 4194304
>
> It is possible I hosed something about my system as I recently began my
> first whack at upgrading a linux kernel.

The SGML docs say that should work. I don't know because I don't use
Linux here. The SGML is at:

http://postgresql.readysetnet.com/devel-corner/docs/admin/kernel-resources.html#SYSVIPC

Let me CC docs on this.

---------------------------------------------------------------------------

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.

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.

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.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

Browse pgsql-docs by date

  From Date Subject
Next Message Bruce Momjian 2001-05-04 01:54:25 Re: Readysetnet FTP mirror broken
Previous Message Bruce Momjian 2001-05-03 15:49:17 Re: Update for SHMALL