From: Magnus Hagander <magnus@hagander.net>
To: Harald Armin Massa <haraldarminmassa@gmail.com>
Cc: Heikki Linnakangas <heikki@enterprisedb.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Kernel cache vs shared_buffers
Date: Sun, 13 May 2007 12:39:04 +0200
Message-ID: <4646EAC8.2040008@hagander.net> (raw)
In-Reply-To: <7be3f35d0705130257o1ce62db6t7512e964a99c23f2@mail.gmail.com>
References: <00b301c79486$1c54da80$0200a8c0@saturn>
<4645CF1D.1030309@enterprisedb.com>
<7be3f35d0705130139o218a2a38l6471d6c8aeb1c71f@mail.gmail.com>
<4646DD4E.4000301@enterprisedb.com>
<7be3f35d0705130257o1ce62db6t7512e964a99c23f2@mail.gmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: magnus@hagander.net, haraldarminmassa@gmail.com, heikki@enterprisedb.com
Subject: Re: Kernel cache vs shared_buffers
In-Reply-To: <4646EAC8.2040008@hagander.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox