Re: [PERFORM] Tunning FreeeBSD and PostgreSQL

2003-07-22 Thread Vivek Khera
 BM == Bruce Momjian [EMAIL PROTECTED] writes:

 not anything pre-allocated (from my understanding).  These settings
 allow for up to 100,000 shared buffers (I currently only use 30,000
 buffers)

BM I think the only downside to making them too big is that you allocate
BM page tables and prevent that address range from being used by other

Does this apply in general or just on FreeBSD?

BM processes.  Of course, if you have much less than 4 gigs of RAM in the
BM machine, it probably isn't an issue.

Probably, but wasting page table entries is never a good idea...

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.Khera Communications, Inc.
Internet: [EMAIL PROTECTED]   Rockville, MD   +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera   http://www.khera.org/~vivek/

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [PERFORM] Tunning FreeeBSD and PostgreSQL

2003-07-22 Thread Bruce Momjian
Vivek Khera wrote:
  BM == Bruce Momjian [EMAIL PROTECTED] writes:
 
  not anything pre-allocated (from my understanding).  These settings
  allow for up to 100,000 shared buffers (I currently only use 30,000
  buffers)
 
 BM I think the only downside to making them too big is that you allocate
 BM page tables and prevent that address range from being used by other
 
 Does this apply in general or just on FreeBSD?

Let me tell you how it traditionally worked  --- each process has the
kernel address space accessible at a fixed address --- it has to so the
process can make kernel calls and run those kernel calls in its own
address space, though with a kernel stack and data space.

What they did with shared memory was to put shared memory in the same
address space with the kernel, because everyone had that address range
mapped into their address space already.  If each process had its own
private copy of the kernel page tables, there is bloat in having the
kernel address space be larger than required.  However, if the kernel
page tables are shared by all processes, then there isn't much bloat,
just less addressable user memory, and if you don't have anything near 4
gigs of RAM, it isn't a problem.

I know Linux has pagable shared memory, and you can resize the maximum
in a running kernel, so it seems they must have abandonded the linkage
between shared page tables and the kernel.  This looks interesting:

http://www.linux-tutorial.info/cgi-bin/display.pl?3120003

and the Contents on the left show additional info like the i386 virtual
directory/page tables:

http://www.linux-tutorial.info/cgi-bin/display.pl?2610003

So it seems Linux has moved in the direction of making shared memory act
just like ordinary allocated memory, except it is shared, meaning I
think each process has its own pages tables for the shared memory.  Once
you do that, you get the ability to size it however you want, but you
lose shared page tables, and it can now be swapped out, which can be bad
for performance.

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [PERFORM] Tunning FreeeBSD and PostgreSQL

2003-07-22 Thread Vivek Khera
 BM == Bruce Momjian [EMAIL PROTECTED] writes:

BM I know Linux has pagable shared memory, and you can resize the maximum
BM in a running kernel, so it seems they must have abandonded the linkage
BM between shared page tables and the kernel.  This looks interesting:

Thanks for the info.  You can resize it in FreeBSD as well, using the
sysctl command to set the various kern.ipc.shm* values.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.Khera Communications, Inc.
Internet: [EMAIL PROTECTED]   Rockville, MD   +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera   http://www.khera.org/~vivek/

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [PERFORM] Tunning FreeeBSD and PostgreSQL

2003-07-21 Thread Bruce Momjian
Vivek Khera wrote:
  SH == Stephen Howie [EMAIL PROTECTED] writes:
 
 SH Richard-
 SH That was very helpfull Thanks!
 SH I still would like some guidance on tunning FreeBSD (shmmax and shmmaxpgs).
 SH Do I need to even touch these settings?
 
 Here's what I use on FreeBSD 4.7/4.8.  The kernel settings don't hurt
 anything being too large for the SHM values, since they are limits,
 not anything pre-allocated (from my understanding).  These settings
 allow for up to 100,000 shared buffers (I currently only use 30,000
 buffers)

I think the only downside to making them too big is that you allocate
page tables and prevent that address range from being used by other
processes.  Of course, if you have much less than 4 gigs of RAM in the
machine, it probably isn't an issue.

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faqs/FAQ.html


Re: [PERFORM] Tunning FreeeBSD and PostgreSQL

2003-07-14 Thread Richard Huxton
On Monday 14 Jul 2003 3:31 pm, Stephen Howie wrote:
[snip]
 My problem is that I have not totally put my head around the concepts of
 the shmmax, shmmaxpgs, etc  As it pertains to my current setup and the
 shared mem values in postgresql.conf.  I'm looking for a good rule of thumb
 when approaching this.  Any help or direction would be greatly appreciated.

There are two articles recently posted here:

http://www.varlena.com/GeneralBits/

They should provide a good start.
-- 
  Richard Huxton

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [PERFORM] Tunning FreeeBSD and PostgreSQL

2003-07-14 Thread Stephen Howie
Richard-

That was very helpfull Thanks!
I still would like some guidance on tunning FreeBSD (shmmax and shmmaxpgs).
Do I need to even touch these settings?

Stephen Howie

There are two articles recently posted here:

http://www.varlena.com/GeneralBits/

They should provide a good start.
-- 
 Richard Huxton

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [PERFORM] Tunning FreeeBSD and PostgreSQL

2003-07-14 Thread Nick Fankhauser

 I still would like some guidance on tunning FreeBSD (shmmax and
 shmmaxpgs).
 Do I need to even touch these settings?

Stephen- I have no idea what these are set to by default in FreeBSD, but
here's the page that covers changing it in the postgresql docs:

http://www.postgresql.org/docs/7.3/static/kernel-resources.html

-Nick


---(end of broadcast)---
TIP 8: explain analyze is your friend