pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Vivek Khera <khera@kcilink.com>
To: pgsql-performance@postgresql.org
Subject: Re: Tunning FreeeBSD and PostgreSQL
Date: Tue, 15 Jul 2003 12:44:37 -0400
Message-ID: <x7d6gbyc22.fsf@yertle.int.kciLink.com> (raw)
References: <012701c34a14$9b60ce80$c40712ac@showie>
	<200307141702.25620.dev@archonet.com>
	<017201c34a2c$a4fd5c70$c40712ac@showie>

>>>>> "SH" == Stephen Howie <showie@centwire.com> 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)


options         SYSVMSG                 #SYSV-style message queues

# only purpose of this box is to run PostgreSQL, which needs tons of shared
# memory, and some semaphores.
# Postgres allocates buffers in 8k chunks, so tell Postgres to use about
# 150 fewer than SHMMAXPGS/2 buffers to leave some room for other Postgres
# shared memory needs.
options         SYSVSHM                 #SYSV-style shared memory
# Maximum number of shared memory pages system wide.
options         SHMALL=262144
# Maximum size, in pages (4k), of a single System V shared memory region.
options         SHMMAXPGS=262144

# only need semaphores for PostgreSQL
options         SYSVSEM                 #SYSV-style semaphores
# Maximum number of System V semaphores that can be used on the system at
# one time.
options         SEMMNI=32
# Total number of semaphores system wide
options         SEMMNS=512
# Maximum number of entries in a semaphore map.
options         SEMMAP=256


Also, in /etc/sysctl.conf I put

# need lots of files for database
kern.maxfiles=8000
# tuning for PostgreSQL
kern.ipc.shm_use_phys=1



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



view thread (11+ messages)  latest in thread

Message-ID: <x7d6gbyc22.fsf@yertle.int.kciLink.com>
Permalink:  ../x7d6gbyc22.fsf@yertle.int.kciLink.com/
Also on:    postgresql.org/message-id/x7d6gbyc22.fsf@yertle.int.kciLink.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: khera@kcilink.com
  Subject: Re: Tunning FreeeBSD and PostgreSQL
  In-Reply-To: <x7d6gbyc22.fsf@yertle.int.kciLink.com>
  References: <012701c34a14$9b60ce80$c40712ac@showie> <200307141702.25620.dev@archonet.com> <017201c34a2c$a4fd5c70$c40712ac@showie> <x7d6gbyc22.fsf@yertle.int.kciLink.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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