X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id D40009FB274 for ; Tue, 15 Aug 2006 12:05:38 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 82897-08 for ; Tue, 15 Aug 2006 15:05:32 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id 9BEA59FB269 for ; Tue, 15 Aug 2006 12:05:32 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id 160575644D; Tue, 15 Aug 2006 10:05:31 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Tue, 15 Aug 2006 10:05:30 -0500 Date: Tue, 15 Aug 2006 10:05:30 -0500 From: "Jim C. Nasby" To: Richard Huxton Cc: Carl Youngblood , pgsql-performance@postgresql.org Subject: Re: Beginner optimization questions, esp. regarding Tsearch2 Message-ID: <20060815150529.GO27928@pervasive.com> References: <44DAFB2B.4070307@archonet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44DAFB2B.4070307@archonet.com> X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Hashcash: 1:20:060815:dev@archonet.com::Bi1lfT/jWgMC5mUz:01T+m X-Hashcash: 1:20:060815:carl@youngbloods.org::sXUHiTUli47gX7wp:00000000000000000 0000000000000000000000005mwP X-Hashcash: 1:20:060815:pgsql-performance@postgresql.org::zgQsLc+HblCanYrY:00000 0000000000000000000000001Qg8 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200608/222 X-Sequence-Number: 20407 On Thu, Aug 10, 2006 at 10:23:55AM +0100, Richard Huxton wrote: > Carl Youngblood wrote: > >- I noticed that there are six different postmaster daemons running. > >Only one of them is taking up a lot of RAM (1076m virtual and 584m > >resident). The second one is using 181m resident while the others are > >less than 20m each. Is it normal to have multiple postmaster > >processes? > > You should have one master backend process and one per connection. PG is > a classic multi-process designed server. > > > Even the biggest process doesn't seem to be using near as > >much RAM as I have on this machine. Is that bad? What percentage of > >my physical memory should I expect postgres to use for itself? How > >can I encourage it to cache more query results in memory? > > OK - one of the key things with PostgreSQL is that it relies on the O.S. > to cache its disk files. So, allocating too much memory to PG can be > counterproductive. > > From your figures, you're allocating about 64MB to work_mem, which is > per sort. So, a complex query could use several times that amount. If > you don't have many concurrent queries that might be what you want. > > Also, you've allocated 1GB to your shared_buffers which is more than I'd > use as a starting point. See the recent thread about how old rules of thumb for shared_buffers are now completely bunk. With 4G of memory, setting shared_buffers to 2G could easily be reasonable. The OP really needs to test several different values with their actual workload and see what works best. > You've only mentioned one main table with 100,000 rows, so presumably > you're going to cache the entire DB in RAM. So, you'll want to increase > effective_cache_size and reduce random_page_cost. > > -- > Richard Huxton > Archonet Ltd > > ---------------------------(end of broadcast)--------------------------- > TIP 2: Don't 'kill -9' the postmaster > -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461