Re: shared memory

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: John Henderson <jrh(at)is(dot)com(dot)fj>
Cc: bsdi-users(at)mailinglists(dot)org, pgsql-general(at)hub(dot)org, "Sin'ichiro MIYATANI" <siu(at)phaseone(dot)co(dot)jp>, daniel(at)digsys(dot)bg
Subject: Re: shared memory
Date: 2000-06-01 20:25:55
Message-ID: 200006012025.QAA26036@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

OK, John, I think I have an answer for you. It is not pretty. You
actually got pretty close.

First, increase SHMMAXPGS by 1024 for every additional 4MB of shared
memory:

/sys/sys/shm.h:69:#define SHMMAXPGS 1024 /* max hardware pages...

The default setting of 1024 is for a maximum of 4MB of shared memory.

Second, use bpatch to find the sysptsize value for the current kernel.
This is computed dynamically at bootup.

$ bpatch -r sysptsize
0x9 = 9

Next, change SYSPTSIZE to a hard-coded value. Use the bpatch value,
plus add 1 for every additional 4MB of shared memory you desire.

/sys/i386/i386/i386_param.c:28:#define SYSPTSIZE 0 /* dynamically...

sysptsize can not be changed by sysctl on the fly.

This should clearly be easier to do on BSDI. I will add a BSDI FAQ for
PostgreSQL to cover this. One downside is that shared memory is not
pageable. It is locked in RAM.

Sorry I am getting to this so late. I just finished my book.

--
Bruce Momjian | http://www.op.net/~candle
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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Elliot Finley 2000-06-01 20:51:13 Q: Truncated output
Previous Message Jerry Lynde 2000-06-01 20:13:25 Re: Postmaster won't -HUP