pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Default shared memory SGML mention
10+ messages / 2 participants
[nested] [flat]

* Default shared memory SGML mention
@ 2001-05-02 16:17  Bruce Momjian <pgman@candle.pha.pa.us>
  0 siblings, 1 reply; 10+ messages in thread

From: Bruce Momjian @ 2001-05-02 16:17 UTC (permalink / raw)
  To: pgsql-docs

I am looking over the shared memory SGML files, and found that on my
BSD/OS system, I get as the following default shared memory size:

m       131072      5432001 --rw------- postgres     user postgres    
user      1 1236992  10622  10622 12:11:14 12:11:15 12:11:14

            ^^^^^^^

I have highlighted the size.  If I subtract the default shared memory
buffers, I get:

	1236992 - 8192 * 64
	
	712704

so by my computations, we need about 700k added to the shared buffer
cache area.  The documentation says to add 512k, not 700k.  My guess is
that the non-cached shared memory area has increased in a recent
release, and docs were not updated.  I will bump up the SGML mention to
700k unless someone shows a lower default shared memory size.

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



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: Default shared memory SGML mention
@ 2001-05-02 22:08  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Bruce Momjian <pgman@candle.pha.pa.us>
  0 siblings, 1 reply; 10+ messages in thread

From: Tom Lane @ 2001-05-02 22:08 UTC (permalink / raw)
  To: Bruce Momjian <pgman@candle.pha.pa.us>; +Cc: pgsql-docs

Bruce Momjian <pgman@candle.pha.pa.us> writes:
> so by my computations, we need about 700k added to the shared buffer
> cache area.  The documentation says to add 512k, not 700k.

This would depend on your -N setting.

A little experimentation shows that the present multiplier for -B is
about 8350 bytes and the multiplier for -N about 14580 bytes on my
system (HPUX), which extrapolates to a fixed base of about 250K plus
the -B and -N contributions.  In reality I believe the computation
is somewhat nonlinear, but that's probably close enough for starters.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: Default shared memory SGML mention
@ 2001-05-08 18:01  Bruce Momjian <pgman@candle.pha.pa.us>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 10+ messages in thread

From: Bruce Momjian @ 2001-05-08 18:01 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-docs

> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > so by my computations, we need about 700k added to the shared buffer
> > cache area.  The documentation says to add 512k, not 700k.
> 
> This would depend on your -N setting.
> 
> A little experimentation shows that the present multiplier for -B is
> about 8350 bytes and the multiplier for -N about 14580 bytes on my
> system (HPUX), which extrapolates to a fixed base of about 250K plus
> the -B and -N contributions.  In reality I believe the computation
> is somewhat nonlinear, but that's probably close enough for starters.

I have updated the SGML sources to say for default shared memory values:

	250 kB + 8192 * buffers or infinity

Of course, buffers is 2 * connections by default.

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



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: Default shared memory SGML mention
@ 2001-05-08 20:05  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Bruce Momjian <pgman@candle.pha.pa.us>
  0 siblings, 1 reply; 10+ messages in thread

From: Tom Lane @ 2001-05-08 20:05 UTC (permalink / raw)
  To: Bruce Momjian <pgman@candle.pha.pa.us>; +Cc: pgsql-docs

Bruce Momjian <pgman@candle.pha.pa.us> writes:
>> A little experimentation shows that the present multiplier for -B is
>> about 8350 bytes and the multiplier for -N about 14580 bytes on my
>> system (HPUX), which extrapolates to a fixed base of about 250K plus
>> the -B and -N contributions.  In reality I believe the computation
>> is somewhat nonlinear, but that's probably close enough for starters.

> I have updated the SGML sources to say for default shared memory values:

> 	250 kB + 8192 * buffers or infinity

How did infinity get into this?  And what happened to the -N
contribution?

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: Default shared memory SGML mention
@ 2001-05-08 20:06  Bruce Momjian <pgman@candle.pha.pa.us>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 10+ messages in thread

From: Bruce Momjian @ 2001-05-08 20:06 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-docs

> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> >> A little experimentation shows that the present multiplier for -B is
> >> about 8350 bytes and the multiplier for -N about 14580 bytes on my
> >> system (HPUX), which extrapolates to a fixed base of about 250K plus
> >> the -B and -N contributions.  In reality I believe the computation
> >> is somewhat nonlinear, but that's probably close enough for starters.
> 
> > I have updated the SGML sources to say for default shared memory values:
> 
> > 	250 kB + 8192 * buffers or infinity
> 
> How did infinity get into this?  And what happened to the -N
> contribution?

Infinity was always there.  The column is labeled "Typical Values".  As
far as -N, buffers is always 2*N, right, so I figured it was in there
already.


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



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: Default shared memory SGML mention
@ 2001-05-08 20:17  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Bruce Momjian <pgman@candle.pha.pa.us>
  0 siblings, 1 reply; 10+ messages in thread

From: Tom Lane @ 2001-05-08 20:17 UTC (permalink / raw)
  To: Bruce Momjian <pgman@candle.pha.pa.us>; +Cc: pgsql-docs

Bruce Momjian <pgman@candle.pha.pa.us> writes:
> far as -N, buffers is always 2*N, right, so I figured it was in there
> already.

No, it isn't, and buffers is NOT always 2*N.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: Default shared memory SGML mention
@ 2001-05-08 20:23  Bruce Momjian <pgman@candle.pha.pa.us>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 10+ messages in thread

From: Bruce Momjian @ 2001-05-08 20:23 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-docs

> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > far as -N, buffers is always 2*N, right, so I figured it was in there
> > already.
> 
> No, it isn't, and buffers is NOT always 2*N.

Yes, but shared memory limits are based on buffers, not connections,
right?  The per-connection overhead is pretty small, no?

If it is buffers and connections, how much is connections and how much
buffers.  I know buffers is 8k.

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



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: Default shared memory SGML mention
@ 2001-05-08 20:37  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Bruce Momjian <pgman@candle.pha.pa.us>
  0 siblings, 2 replies; 10+ messages in thread

From: Tom Lane @ 2001-05-08 20:37 UTC (permalink / raw)
  To: Bruce Momjian <pgman@candle.pha.pa.us>; +Cc: pgsql-docs

Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Yes, but shared memory limits are based on buffers, not connections,
> right?  The per-connection overhead is pretty small, no?

I gave you my experimentally-derived formula already:

	250Kb + 8350 * B + 14580 * N

I don't see how you can consider the N term negligible.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: Default shared memory SGML mention
@ 2001-05-08 20:54  Bruce Momjian <pgman@candle.pha.pa.us>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 10+ messages in thread

From: Bruce Momjian @ 2001-05-08 20:54 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-docs

> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Yes, but shared memory limits are based on buffers, not connections,
> > right?  The per-connection overhead is pretty small, no?
> 
> I gave you my experimentally-derived formula already:
> 
> 	250Kb + 8350 * B + 14580 * N
> 
> I don't see how you can consider the N term negligible.

Oh, I misread it.  I thought the 14.5k was part of the 250k.  Let me fix
that.

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



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: Default shared memory SGML mention
@ 2001-05-08 21:11  Bruce Momjian <pgman@candle.pha.pa.us>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 10+ messages in thread

From: Bruce Momjian @ 2001-05-08 21:11 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-docs

> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Yes, but shared memory limits are based on buffers, not connections,
> > right?  The per-connection overhead is pretty small, no?
> 
> I gave you my experimentally-derived formula already:
> 
> 	250Kb + 8350 * B + 14580 * N
> 
> I don't see how you can consider the N term negligible.

OK, patch applied.

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

Attachments:

/bjm/diff (text/plain, 831B) download Index: doc/src/sgml/runtime.sgml =================================================================== RCS file: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/runtime.sgml,v retrieving revision 1.64 diff -c -r1.64 runtime.sgml *** doc/src/sgml/runtime.sgml 2001/05/07 15:55:27 1.64 --- doc/src/sgml/runtime.sgml 2001/05/08 21:09:21 *************** *** 1481,1487 **** <row> <entry><varname>SHMMAX</></> <entry>Maximum size of shared memory segment (bytes)</> ! <entry>250 kB + 8192 * buffers or infinity</entry> </row> <row> --- 1481,1487 ---- <row> <entry><varname>SHMMAX</></> <entry>Maximum size of shared memory segment (bytes)</> ! <entry>250 kB + 8.2kB * buffers + 14.2kB * max_connections or infinity</entry> </row> <row>
^ permalink raw reply [nested|flat] 10+ messages in thread


end of thread, other threads:[~2001-05-08 21:11 UTC | newest]

Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-05-02 16:17 Default shared memory SGML mention Bruce Momjian <pgman@candle.pha.pa.us>
2001-05-02 22:08 ` Tom Lane <tgl@sss.pgh.pa.us>
2001-05-08 18:01   ` Bruce Momjian <pgman@candle.pha.pa.us>
2001-05-08 20:05     ` Tom Lane <tgl@sss.pgh.pa.us>
2001-05-08 20:06       ` Bruce Momjian <pgman@candle.pha.pa.us>
2001-05-08 20:17         ` Tom Lane <tgl@sss.pgh.pa.us>
2001-05-08 20:23           ` Bruce Momjian <pgman@candle.pha.pa.us>
2001-05-08 20:37             ` Tom Lane <tgl@sss.pgh.pa.us>
2001-05-08 20:54               ` Bruce Momjian <pgman@candle.pha.pa.us>
2001-05-08 21:11               ` 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