From: | Jim Nasby <jim(at)nasby(dot)net> |
---|---|
To: | David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Clock sweep not caching enough B-Tree leaf pages? |
Date: | 2014-04-22 18:58:06 |
Message-ID: | 5356BBBE.80203@nasby.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 4/21/14, 6:07 PM, David G Johnston wrote:
> Jim Nasby-2 wrote
>>> >>I feel that if there is no memory pressure, frankly it doesnt matter much
>>> >>about what gets out and what not. The case I am specifically targeting is
>>> >>when the clocksweep gets to move about a lot i.e. high memory pressure
>>> >>workloads. Of course, I may be totally wrong here.
>> >
>> >Well, there's either memory pressure or there isn't. If there isn't then
>> >it's all moot*because we're not evicting anything*.
> The trade-off I'm seeing here is between measuring when there is no memory
> pressure - and thus eating at performance while not actually evicting
> buffers - and not measuring but then encountering memory pressure and not
> having a clue as to what should be evicted.
Right. OSes handle this by keeping a certain ratio of active vs inactive pages, regardless of pressure for free pages. That way when you need more pages in the free list you can pull them from the inactive list knowing that you're making a good decision.
One of the really nice things about this approach is that if memory pressure is low enough that you don't need more pages on the inactive list you don't even need to run that clock.
--
Jim C. Nasby, Data Architect jim(at)nasby(dot)net
512.569.9461 (cell) http://jim.nasby.net
From | Date | Subject | |
---|---|---|---|
Next Message | Claudio Freire | 2014-04-22 19:14:21 | Re: RFC: Async query processing |
Previous Message | Florian Weimer | 2014-04-22 18:49:40 | Re: RFC: Async query processing |