Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 7BF552E0050 for ; Fri, 2 May 2008 17:13:44 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 45859-06 for ; Fri, 2 May 2008 17:13:38 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by developer.postgresql.org (Postfix) with ESMTP id BB8B22E002D for ; Fri, 2 May 2008 17:13:40 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m42KDbHI021404; Fri, 2 May 2008 16:13:37 -0400 (EDT) To: "Scott Marlowe" cc: "Alexy Khrabrov" , pgsql-performance@postgresql.org Subject: Re: two memory-consuming postgres processes In-reply-to: References: <27A4D379-2553-496D-A96C-102F2A5E62C2@gmail.com> Comments: In-reply-to "Scott Marlowe" message dated "Fri, 02 May 2008 13:53:56 -0600" Date: Fri, 02 May 2008 16:13:37 -0400 Message-ID: <21403.1209759217@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/23 X-Sequence-Number: 29991 "Scott Marlowe" writes: > On Fri, May 2, 2008 at 1:38 PM, Alexy Khrabrov wrote: >> I randomly increased values in postgresql.conf to >> >> shared_buffers = 1500MB >> max_fsm_pages = 2000000 >> max_fsm_relations = 10000 > On a laptop with 2G ram, 1.5Gig shared buffers is probably WAY too high. s/probably/definitely/, especially seeing that OS X is a bit of a memory hog itself. I don't think you should figure on more than 1GB being usefully available to Postgres, and you can't give all or even most of that space to shared_buffers. > No, the background writer reads through the shared buffers for dirty > ones and writes them out. so, it's not really using MORE memory, it's > just showing that it's attached to the ginormous shared_buffer pool > you've set up. Yeah. You have to be aware of top's quirky behavior for shared memory: on most platforms it will count the shared memory against *each* process, but only as much of the shared memory as that process has touched so far. So over time the reported size of any PG process will tend to climb to something over the shared memory size, but most of that isn't "real". I haven't directly checked whether OS X's top behaves that way, but given your report I think it does. regards, tom lane