X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.225.181]) by svr1.postgresql.org (Postfix) with ESMTP id 2EA5ECC42E for ; Tue, 15 Jul 2003 16:44:30 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr5.postgresql.org [64.117.225.181]) (amavisd-new, port 10024) with ESMTP id 58140-04 for ; Tue, 15 Jul 2003 16:44:48 +0000 (GMT) Received: from lorax.kciLink.com (lorax.kciLink.com [206.112.95.1]) by svr1.postgresql.org (Postfix) with ESMTP id 099A6CC427 for ; Tue, 15 Jul 2003 13:44:19 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by lorax.kciLink.com (Postfix) with ESMTP id 625503E81 for ; Tue, 15 Jul 2003 12:44:48 -0400 (EDT) Received: from lorax.kciLink.com ([127.0.0.1]) by localhost (lorax.kciLink.com [127.0.0.1]) (amavisd-new, port 10024) with SMTP id 67661-09 for ; Tue, 15 Jul 2003 12:44:38 -0400 (EDT) Received: by lorax.kciLink.com (Postfix, from userid 8) id 08F843E5A; Tue, 15 Jul 2003 12:44:38 -0400 (EDT) To: pgsql-performance@postgresql.org Path: not-for-mail From: Vivek Khera Newsgroups: ml.postgres.performance Subject: Re: Tunning FreeeBSD and PostgreSQL Date: Tue, 15 Jul 2003 12:44:37 -0400 Organization: Khera Communications, Inc., Rockville, MD Lines: 52 Message-ID: References: <012701c34a14$9b60ce80$c40712ac@showie> <200307141702.25620.dev@archonet.com> <017201c34a2c$a4fd5c70$c40712ac@showie> NNTP-Posting-Host: yertle.kcilink.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: lorax.kciLink.com 1058287478 41564 216.194.193.105 (15 Jul 2003 16:44:38 GMT) X-Complaints-To: daemon@kciLink.com NNTP-Posting-Date: Tue, 15 Jul 2003 16:44:38 +0000 (UTC) User-Agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.4 (Portable Code, berkeley-unix) Cancel-Lock: sha1:dX6CBbs9tUMIV931MgOXMfyQLZM= X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/233 X-Sequence-Number: 2526 >>>>> "SH" == Stephen Howie 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/