From showie@centwire.com Mon Jul 14 14:27:02 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.192]) by svr1.postgresql.org (Postfix) with ESMTP id 992EECC003 for ; Mon, 14 Jul 2003 14:27:02 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr4.postgresql.org [64.117.224.192]) (amavisd-new, port 10024) with ESMTP id 17452-08 for ; Mon, 14 Jul 2003 14:27:22 +0000 (GMT) Received: from domain.com (unknown [208.254.142.2]) by svr1.postgresql.org (Postfix) with SMTP id 400B9CBC33 for ; Mon, 14 Jul 2003 11:27:00 -0300 (ADT) Received: (qmail 80882 invoked from network); 14 Jul 2003 14:27:24 -0000 Received: from unknown (HELO localhost) (127.0.0.1) by localhost.uu.net with SMTP; 14 Jul 2003 14:27:24 -0000 Received: from showie ([172.18.7.196] [172.18.7.196]) by mail1.centwire.com (VaMailArmor-2.0.1.7) id 80820-07545FFD; Mon, 14 Jul 2003 09:27:21 -0500 Message-ID: <012701c34a14$9b60ce80$c40712ac@showie> From: "Stephen Howie" To: Subject: Tunning FreeeBSD and PostgreSQL Date: Mon, 14 Jul 2003 09:31:26 -0500 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0124_01C349EA.B2860B90" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-AntiVirus: checked by Vexira MailArmor (version: 2.0.1.7; VAE: 6.20.0.1; VDF: 6.20.0.37; host: mail2.centwire.com) X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=1.2 tagged_above=0.0 required=5.0 tests=HTML_40_50, HTML_MESSAGE X-Spam-Level: * X-Archive-Number: 200307/220 X-Sequence-Number: 2513 This is a multi-part message in MIME format. ------=_NextPart_000_0124_01C349EA.B2860B90 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Tried to search the list but the search wasn't working. I have a server running strictly PostgreSQL that I'm trying to tune for per= formance. The specs are 2 X 2.4 Athlon MP processors 2G Reg DDR FreeBSD 4.8 SMP kernel complied PostgreSQL 7.3.3 4 X 80G IDE Raid 5 My problem is that I have not totally put my head around the concepts of th= e shmmax, shmmaxpgs, etc.... As it pertains to my current setup and the sh= ared mem values in postgresql.conf. I'm looking for a good rule of thumb w= hen approaching this. Any help or direction would be greatly appreciated. Thanks Stephen Howie ------=_NextPart_000_0124_01C349EA.B2860B90 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Tried to search the list but the search wa= sn't=20 working.
 
I have a server running strictly PostgreSQ= L that=20 I'm trying to tune for performance. The specs are
 
2 X 2.4 Athlon MP processors
2G Reg DDR
FreeBSD 4.8 SMP kernel complied
PostgreSQL 7.3.3
4 X 80G IDE Raid 5
 
My problem is that I have not totally put = my head=20 around the concepts of the shmmax, shmmaxpgs, etc....  As it pertains = to my=20 current setup and the shared mem values in postgresql.conf.  I'm looki= ng=20 for a good rule of thumb when approaching this.  Any help or direction= =20 would be greatly appreciated.
 
Thanks
Stephen Howie
------=_NextPart_000_0124_01C349EA.B2860B90-- From dev@archonet.com Mon Jul 14 16:02:03 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.192]) by svr1.postgresql.org (Postfix) with ESMTP id 3913CCC086 for ; Mon, 14 Jul 2003 16:02:03 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr4.postgresql.org [64.117.224.192]) (amavisd-new, port 10024) with ESMTP id 41417-03 for ; Mon, 14 Jul 2003 16:02:24 +0000 (GMT) Received: from anchor-post-35.mail.demon.net (anchor-post-35.mail.demon.net [194.217.242.85]) by svr1.postgresql.org (Postfix) with ESMTP id 4B765CC00B for ; Mon, 14 Jul 2003 13:01:57 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-35.mail.demon.net with esmtp (Exim 3.36 #2) id 19c5mL-0005Ax-0Z; Mon, 14 Jul 2003 17:02:17 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id B043A17D4C; Mon, 14 Jul 2003 17:02:15 +0100 (BST) Received: from client.archonet.com (client.archonet.com [192.168.1.16]) by mainbox.archonet.com (Postfix) with ESMTP id 1841116BFB; Mon, 14 Jul 2003 17:02:15 +0100 (BST) Content-Type: text/plain; charset="iso-8859-1" From: Richard Huxton Organization: Archonet Ltd To: "Stephen Howie" , Subject: Re: Tunning FreeeBSD and PostgreSQL Date: Mon, 14 Jul 2003 17:02:25 +0100 User-Agent: KMail/1.4.3 References: <012701c34a14$9b60ce80$c40712ac@showie> In-Reply-To: <012701c34a14$9b60ce80$c40712ac@showie> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200307141702.25620.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/221 X-Sequence-Number: 2514 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 thu= mb > when approaching this. Any help or direction would be greatly appreciate= d. There are two articles recently posted here: http://www.varlena.com/GeneralBits/ They should provide a good start. --=20 Richard Huxton From showie@centwire.com Mon Jul 14 17:19:04 2003 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 A13D6CC0C5 for ; Mon, 14 Jul 2003 17:19:04 +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 21663-09 for ; Mon, 14 Jul 2003 17:19:28 +0000 (GMT) Received: from domain.com (unknown [208.254.142.2]) by svr1.postgresql.org (Postfix) with SMTP id 5C3E9CC0AB for ; Mon, 14 Jul 2003 14:19:02 -0300 (ADT) Received: (qmail 50430 invoked from network); 14 Jul 2003 17:19:27 -0000 Received: from unknown (HELO localhost) (127.0.0.1) by localhost.uu.net with SMTP; 14 Jul 2003 17:19:27 -0000 Received: from showie ([172.18.7.196] [172.18.7.196]) by mail1.centwire.com (VaMailArmor-2.0.1.7) id 50396-291F60B5; Mon, 14 Jul 2003 12:19:25 -0500 Message-ID: <017201c34a2c$a4fd5c70$c40712ac@showie> From: "Stephen Howie" To: "Richard Huxton" , References: <012701c34a14$9b60ce80$c40712ac@showie> <200307141702.25620.dev@archonet.com> Subject: Re: Tunning FreeeBSD and PostgreSQL Date: Mon, 14 Jul 2003 12:23:30 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-AntiVirus: checked by Vexira MailArmor (version: 2.0.1.7; VAE: 6.20.0.1; VDF: 6.20.0.37; host: mail2.centwire.com) X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/224 X-Sequence-Number: 2517 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 From nickf@ontko.com Mon Jul 14 17:59:01 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.192]) by svr1.postgresql.org (Postfix) with ESMTP id A2AE8CC0ED for ; Mon, 14 Jul 2003 17:59:01 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr4.postgresql.org [64.117.224.192]) (amavisd-new, port 10024) with ESMTP id 95218-01 for ; Mon, 14 Jul 2003 17:59:25 +0000 (GMT) Received: from shire.ontko.com (shire.ontko.com [199.164.165.1]) by svr1.postgresql.org (Postfix) with ESMTP id 5FF6DCC0AB for ; Mon, 14 Jul 2003 14:58:59 -0300 (ADT) Received: from nick (bilbo.ontko.com [199.164.165.101]) by shire.ontko.com (8.12.3/8.12.3/Debian-6.4) with SMTP id h6EHxN0P012822; Mon, 14 Jul 2003 12:59:23 -0500 Reply-To: From: "Nick Fankhauser" To: "Stephen Howie" , Subject: Re: Tunning FreeeBSD and PostgreSQL Date: Mon, 14 Jul 2003 12:57:55 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 In-Reply-To: <017201c34a2c$a4fd5c70$c40712ac@showie> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/226 X-Sequence-Number: 2519 > 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 From khera@kcilink.com Tue Jul 15 16:44:30 2003 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/ From showie@centwire.com Tue Jul 15 17:10:10 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.192]) by svr1.postgresql.org (Postfix) with ESMTP id 63B24CC40B for ; Tue, 15 Jul 2003 17:10:10 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr4.postgresql.org [64.117.224.192]) (amavisd-new, port 10024) with ESMTP id 39051-09 for ; Tue, 15 Jul 2003 17:10:38 +0000 (GMT) Received: from domain.com (unknown [208.254.142.2]) by svr1.postgresql.org (Postfix) with SMTP id 72FA4CB571 for ; Tue, 15 Jul 2003 14:10:08 -0300 (ADT) Received: (qmail 72648 invoked from network); 15 Jul 2003 17:10:36 -0000 Received: from unknown (HELO localhost) (127.0.0.1) by localhost.uu.net with SMTP; 15 Jul 2003 17:10:36 -0000 Received: from showie ([172.18.7.196] [172.18.7.196]) by mail1.centwire.com (VaMailArmor-2.0.1.7) id 72609-790785AE; Tue, 15 Jul 2003 12:10:33 -0500 Message-ID: <005e01c34af4$9578e670$c40712ac@showie> From: "Stephen Howie" To: "Vivek Khera" , References: <012701c34a14$9b60ce80$c40712ac@showie> <200307141702.25620.dev@archonet.com> <017201c34a2c$a4fd5c70$c40712ac@showie> Subject: Re: Tunning FreeeBSD and PostgreSQL Date: Tue, 15 Jul 2003 12:14:43 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-AntiVirus: checked by Vexira MailArmor (version: 2.0.1.7; VAE: 6.20.0.1; VDF: 6.20.0.38; host: mail2.centwire.com) X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/234 X-Sequence-Number: 2527 Vivek, Thanks, for your reply. May I ask what you system setup is like (i.e. memory and such)? ----- Original Message ----- From: "Vivek Khera" Newsgroups: ml.postgres.performance To: Sent: Tuesday, July 15, 2003 11:44 AM Subject: Re: [PERFORM] Tunning FreeeBSD and PostgreSQL > >>>>> "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/ > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster > > From khera@kcilink.com Tue Jul 15 18:04:36 2003 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 B69B6CC44F for ; Tue, 15 Jul 2003 18:04:36 +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 60196-06 for ; Tue, 15 Jul 2003 18:04:54 +0000 (GMT) Received: from yertle.kcilink.com (yertle.kcilink.com [216.194.193.105]) by svr1.postgresql.org (Postfix) with ESMTP id 5ECBDCB571 for ; Tue, 15 Jul 2003 15:04:25 -0300 (ADT) Received: by yertle.kcilink.com (Postfix, from userid 100) id D36C62178A; Tue, 15 Jul 2003 14:04:54 -0400 (EDT) From: Vivek Khera MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16148.16966.755692.737018@yertle.int.kciLink.com> Date: Tue, 15 Jul 2003 14:04:54 -0400 To: "Stephen Howie" Cc: Subject: Re: Tunning FreeeBSD and PostgreSQL In-Reply-To: <005e01c34af4$9578e670$c40712ac@showie> References: <012701c34a14$9b60ce80$c40712ac@showie> <200307141702.25620.dev@archonet.com> <017201c34a2c$a4fd5c70$c40712ac@showie> <005e01c34af4$9578e670$c40712ac@showie> X-Mailer: VM 7.14 under 21.4 (patch 12) "Portable Code" XEmacs Lucid X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/235 X-Sequence-Number: 2528 >>>>> "SH" == Stephen Howie writes: SH> Vivek, SH> Thanks, for your reply. May I ask what you system setup is like (i.e. SH> memory and such)? Current box is dual P3 1GHz and 2GB RAM. RAID0+1 on 4 disks. I'm about to order a bigger box, since I'm saturating the disk bandwidth as far as I can measure it. I'm thinking along the lines of 8 disks on RAID0+1 and 4GB RAM. The CPUs twiddle their thumbs a lot, so no point in really beefing that up. From pgman@candle.pha.pa.us Mon Jul 21 20:41:53 2003 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 E9252D1C50F for ; Mon, 21 Jul 2003 20:41:53 +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 22218-09 for ; Mon, 21 Jul 2003 20:41:42 +0000 (GMT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 40F38D1C50D for ; Mon, 21 Jul 2003 17:41:41 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h6LKfbi14090; Mon, 21 Jul 2003 16:41:37 -0400 (EDT) From: Bruce Momjian Message-Id: <200307212041.h6LKfbi14090@candle.pha.pa.us> Subject: Re: Tunning FreeeBSD and PostgreSQL In-Reply-To: To: Vivek Khera Date: Mon, 21 Jul 2003 16:41:37 -0400 (EDT) Cc: pgsql-performance@postgresql.org X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/343 X-Sequence-Number: 2636 Vivek Khera wrote: > >>>>> "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) 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 pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 From khera@kcilink.com Tue Jul 22 14:20:30 2003 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 49A46D1C50C for ; Tue, 22 Jul 2003 14:20: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 03713-04 for ; Tue, 22 Jul 2003 14:20:18 +0000 (GMT) Received: from yertle.kcilink.com (yertle.kcilink.com [216.194.193.105]) by svr1.postgresql.org (Postfix) with ESMTP id 8964FD1C94D for ; Tue, 22 Jul 2003 11:20:18 -0300 (ADT) Received: by yertle.kcilink.com (Postfix, from userid 100) id 6A1352178C; Tue, 22 Jul 2003 10:20:19 -0400 (EDT) From: Vivek Khera MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16157.18467.310482.384436@yertle.int.kciLink.com> Date: Tue, 22 Jul 2003 10:20:19 -0400 To: pgsql-performance@postgresql.org Subject: Re: Tunning FreeeBSD and PostgreSQL In-Reply-To: <200307212041.h6LKfbi14090@candle.pha.pa.us> References: <200307212041.h6LKfbi14090@candle.pha.pa.us> X-Mailer: VM 7.14 under 21.4 (patch 12) "Portable Code" XEmacs Lucid X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/354 X-Sequence-Number: 2647 >>>>> "BM" == Bruce Momjian 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: khera@kciLink.com Rockville, MD +1-240-453-8497 AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/ From pgman@candle.pha.pa.us Tue Jul 22 17:29:20 2003 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 3A8DAD1C7F1 for ; Tue, 22 Jul 2003 17:29:20 +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 87615-04 for ; Tue, 22 Jul 2003 17:29:09 +0000 (GMT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 55E7AD1C7EF for ; Tue, 22 Jul 2003 14:29:08 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h6MHT7M02341; Tue, 22 Jul 2003 13:29:07 -0400 (EDT) From: Bruce Momjian Message-Id: <200307221729.h6MHT7M02341@candle.pha.pa.us> Subject: Re: Tunning FreeeBSD and PostgreSQL In-Reply-To: <16157.18467.310482.384436@yertle.int.kciLink.com> To: Vivek Khera Date: Tue, 22 Jul 2003 13:29:07 -0400 (EDT) Cc: pgsql-performance@postgresql.org X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/364 X-Sequence-Number: 2657 Vivek Khera wrote: > >>>>> "BM" == Bruce Momjian 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?312&0&0&0&3 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?261&0&0&0&3 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 pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 From khera@kcilink.com Tue Jul 22 18:18:40 2003 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 4C6D5D1C4DC for ; Tue, 22 Jul 2003 18:18:40 +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 08070-03 for ; Tue, 22 Jul 2003 18:18:29 +0000 (GMT) Received: from yertle.kcilink.com (yertle.kcilink.com [216.194.193.105]) by svr1.postgresql.org (Postfix) with ESMTP id 6F966D1C4C1 for ; Tue, 22 Jul 2003 15:18:29 -0300 (ADT) Received: by yertle.kcilink.com (Postfix, from userid 100) id 5E77E2178C; Tue, 22 Jul 2003 14:18:15 -0400 (EDT) From: Vivek Khera MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16157.32743.251607.358718@yertle.int.kciLink.com> Date: Tue, 22 Jul 2003 14:18:15 -0400 To: pgsql-performance@postgresql.org Subject: Re: Tunning FreeeBSD and PostgreSQL In-Reply-To: <200307221729.h6MHT7M02341@candle.pha.pa.us> References: <16157.18467.310482.384436@yertle.int.kciLink.com> <200307221729.h6MHT7M02341@candle.pha.pa.us> X-Mailer: VM 7.14 under 21.4 (patch 12) "Portable Code" XEmacs Lucid X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/374 X-Sequence-Number: 2667 >>>>> "BM" == Bruce Momjian 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: khera@kciLink.com Rockville, MD +1-240-453-8497 AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/