Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 23B049FB82C for ; Sun, 13 May 2007 07:38:24 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 13002-05 for ; Sun, 13 May 2007 07:38:21 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from svr2.hagander.net (svr2.hagander.net [88.198.128.226]) by postgresql.org (Postfix) with ESMTP id 8D08A9FB85F for ; Sun, 13 May 2007 07:38:21 -0300 (ADT) Received: from dynamic.hagander.net ([127.0.0.1]) (encrypted and authenticated) by svr2.hagander.net (Postfix) with ESMTP id 40391DCC942; Sun, 13 May 2007 12:38:20 +0200 (CEST) Message-ID: <4646EAC8.2040008@hagander.net> Date: Sun, 13 May 2007 12:39:04 +0200 From: Magnus Hagander User-Agent: Thunderbird 2.0.0.4pre (Windows/20070511) MIME-Version: 1.0 To: Harald Armin Massa CC: Heikki Linnakangas , pgsql-performance@postgresql.org Subject: Re: Kernel cache vs shared_buffers References: <00b301c79486$1c54da80$0200a8c0@saturn> <4645CF1D.1030309@enterprisedb.com> <7be3f35d0705130139o218a2a38l6471d6c8aeb1c71f@mail.gmail.com> <4646DD4E.4000301@enterprisedb.com> <7be3f35d0705130257o1ce62db6t7512e964a99c23f2@mail.gmail.com> In-Reply-To: <7be3f35d0705130257o1ce62db6t7512e964a99c23f2@mail.gmail.com> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/246 X-Sequence-Number: 24636 Harald Armin Massa wrote: > Heikki, > > >> > PostgreSQL on Windows. My current rule of thumb on Windows: set >> > shared_buffers to minimum * 2 >> > Adjust effective_cache_size to the number given as "system cache" >> > within the task manager. >> >> Why? > > I tried with shared_buffers = 50% of available memory, and with 30% of > available memory, and the thoughput on complex queries stalled or got > worse. > > I lowered shared_buffers to minimum, and started raising > effective_cache_size, and performance on real world queries improved. > pg_bench did not fully agree when simulating large numbers concurrent > queries. > > So I tried setting shared_buffers between minimum and 2.5*minimum, and > pg_bench speeds recovered and real world queries did similiar. > > My understanding is that shared_buffers are realised as memory mapped > file in win32; and that they are only usually kept in memory. Maybe I > understood that wrong. Almost. It's a memory mapped region backed by the system pagefile. That said, it would be good to try to figure out *why* this is happening. It's been on my list of things to do to run checks with the profiler (now that we can ;-) with the msvc stuff) and try to figure out where it's slowing down. It could be as simple as that there's much more overhead trying to access the shared memory from different processes than we're used to on other platforms. //Magnus