Skip site navigation (1) Skip section navigation (2)

Re: [performance] fast reads on a busy server

From: Willy-Bas Loos <willybas(at)gmail(dot)com>
To: Hannu Krosing <hannu(at)2ndquadrant(dot)com>
Cc: pgsql-cluster-hackers(at)postgresql(dot)org, pgsql-performance(at)postgresql(dot)org, Greg Smith <greg(at)2ndquadrant(dot)com>
Subject: Re: [performance] fast reads on a busy server
Date: 2012-06-27 10:01:51
Message-ID: CAHnozTgNQD=eoWV_3Zy5BOXwZrO+qAym8kOA0-XBEJRMrEk0wg@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-cluster-hackerspgsql-performance
On Wed, Jun 27, 2012 at 9:34 AM, Hannu Krosing <hannu(at)2ndquadrant(dot)com>wrote:

> Check if you are CPU-bound. On a database which fits fully you may
> already be.
>
> Being CPU-bound is my goal.
That makes your answer a yes to me.

Only i'm afraid that this solution is not optimal.
Because i am stealing more resopurces from the (already busy) rest of the
server than necessary. That's because the file-cache will also be filled
(partially) with data that this cluster uses, unnecessarily. I'm not going
to read from the file cache, because the data will be in the shared_buffers
as soon as they have been read from disk.

So then, would it be better to use 80% of memory for the shared buffers of
the combined clusters?
I've read that 25% is good and 40% is max because of the file cache, but it
doesn't make much sense..

Greg Smith writes
(here<http://www.westnet.com/%7Egsmith/content/postgresql/InsideBufferCache.pdf>,
page 12):
* PostgreSQL is designed to rely heavily on the operating
system cache, because portable sotware like PostgreSQL can’t
know enough about the filesystem or disk layout to make
optimal decisions about how to read and write files
* The shared buffer cache is really duplicating what the
operating system is already doing: caching popular file blocks
* In many cases, you’ll find exactly the same blocks cached by
both the buffer cache and the OS page cache
* This makes is a bad idea to give PostgreSQL too much
memory to manage

I cannot follow that reasoning completely. Who needs OS level file cache
when postgres' shared_buffers is better? The efficiency should go up again
after passing 50% of shared buffers, where you would be caching everything
twice.
The only problem i see is that work_mem and such will end up in SWAP if
there isn't enough memory left over to allocate.

Cheers,

WBL

-- 
"Quality comes from focus and clarity of purpose" -- Mark Shuttleworth

In response to

Responses

pgsql-performance by date

Next:From: Willy-Bas LoosDate: 2012-06-27 11:28:39
Subject: Re: [performance] fast reads on a busy server
Previous:From: Hannu KrosingDate: 2012-06-27 07:34:16
Subject: Re: [performance] fast reads on a busy server

pgsql-cluster-hackers by date

Next:From: Willy-Bas LoosDate: 2012-06-27 11:28:39
Subject: Re: [performance] fast reads on a busy server
Previous:From: Hannu KrosingDate: 2012-06-27 07:34:16
Subject: Re: [performance] fast reads on a busy server

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group