Re: measuring shared memory usage on Windows

From: "Harald Armin Massa" <haraldarminmassa(at)gmail(dot)com>
To: "Magnus Hagander" <mha(at)sollentuna(dot)net>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: measuring shared memory usage on Windows
Date: 2006-10-16 20:30:27
Message-ID: 7be3f35d0610161330r4df390f2uecf8d411c861911c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Magnus,

> That shows that you don't really know how the memory manager in NT+
> works ;-) *ALL* normal file I/O is handled through the memory manager
> :-) So yes, they are both different access methods to the memory
> manager, really.

"don't really" is a overstatement, I do not know at all how the memory
manager works in NT+. All I learned is "Inside Windows NT" of H.
Custer from 1993 :)

So, just to make sure I understood correctly:

If PostgreSQL reads a file from disk, Windows NT does this file I/O
though the same memory manager than when PostgreSQL puts parts of this
read file [for example an index segment] into shared memory - which is
nothing but a file, that usually stays in main memory.

Correct so far?

I continued from this thoughts:

lets say there is 500MB memory available, we have 100MB of
shared_memory configured.
Now PostgreSQL reads 100MB from a file - memory manager takes 100MB
memory to fullfill this file access (optimizations aside)

Now PostgreSQL reshuffles that 100MB and decides: "hmmmm, that may be
valuable for ALL of the currently running postgres.exe" and pushes
those 100MB into shared memory for all to use. It caches the 100MB - a
fine chunk of an index.

From this kind of understanding, memory manager has 200MB in use: the
100MB from the file read, and the 100MB of shared memory.

Of course the 100MB of the file in memory manager will get flushed soon.

Now, lets restrict PostgreSQL: I only give the minimum amout of shared
memory. It will NOT cache those 100MB in shared memory.

But: PostgreSQL really was correct. The other 20 postgres.exe access
the same file on a regular basis. Won't memory manager keep that file
"cached" in RAM anyway?

I try my theories :)) and contrary to all wisdom from all PostgreSQL
tuning recommendations reconfigured shared memory nearly to the
minimum: 1000 for maximum of 400 concurrent connections. (800 would be
minimum). Single user performance was fine, now I am looking forward
to full user scenario tomorrow.

I will keep you posted.

Harald

--
GHUM Harald Massa
persuadere et programmare
Harald Armin Massa
Reinsburgstraße 202b
70197 Stuttgart
0173/9409607
-
Python: the only language with more web frameworks than keywords.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Jim C. Nasby 2006-10-16 20:45:51 Re: Performance Optimization for Dummies 2 - the SQL
Previous Message Mark Kirkwood 2006-10-16 20:25:05 Re: Hints proposal