Re: [PATCHES] How can I use 2GB of shared buffers on Windows?

From: "Takayuki Tsunakawa" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>
To: "Magnus Hagander" <magnus(at)hagander(dot)net>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] How can I use 2GB of shared buffers on Windows?
Date: 2007-02-09 10:31:33
Message-ID: 02d201c74c35$78130ac0$19527c0a@OPERAO
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

From: "Magnus Hagander" <magnus(at)hagander(dot)net>
> Right. Which is why you're likely to see better performance if you
keep
> shared buffers smaller. There is something in dealing with it that's
> slow on win32, per reports from the field. It needs to be
investigated
> further...
> We've had reports that it's slow with large shared_buffers, yes.

That's a shocking news. I'm sad.
I wonder whether the field you are talking about set Windows to use
more memory for programs than for filesystem cache, which is
selectable from [System] applet of Control Panel (Oh, I wonder how my
machine is set in this respect... have to check.) If filesystem cache
is preferred, the following senario may be possible:

1. PostgreSQL tries to read data from disk into database cache.
2. The kernel tries to allocate filesystem buffers by paging out
PostgreSQL's memory (possibly shared buffers).
3. PostgreSQL finds data requested by its clients in database cache,
and tries to get it in memory.
4. But the shared buffers are paged out, and page-ins happen.

> Are you sure you're not running this on for example
> IDE disks with write-cache that lies? Windows will write through
that
> write-cache even if the disk lies, whereas most linux versions
won't. At
> least that used to be the case not too long ago, but there has also
been
> talking about fixign that in linux, so maybe that's done...

I'm using a PC server whose disks are all SCSI. It has no IDE disk.

> Also note that when you run pg_bench on the local machine, you take
a
> much higher hit from the fact that context switching between
processes
> is a lot more expensive on Windows than it is on Linux. But it
shouldn't
> be big enough to explain the huge difference you had in your test.

Yes, I suspect it, too. So, Oracle uses one multi-threaded server
process on Windows, while it employs multi-process architecture. SQL
Server is of course multi-threaded. SRA's original PostgreSQL for
Windows (based on 7.x) was also multi-threaded.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2007-02-09 10:39:33 Re: pgsql: Add lock matrix to documentation.
Previous Message Zeugswetter Andreas ADI SD 2007-02-09 09:27:56 Re: [PATCHES] [pgsql-patches] Phantom Command IDs, updated patch

Browse pgsql-patches by date

  From Date Subject
Next Message Heikki Linnakangas 2007-02-09 11:20:03 Re: [PATCHES] [pgsql-patches] Phantom Command IDs,updated patch
Previous Message Zeugswetter Andreas ADI SD 2007-02-09 09:27:56 Re: [PATCHES] [pgsql-patches] Phantom Command IDs, updated patch