Re: Clock sweep not caching enough B-Tree leaf pages?

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Peter Geoghegan <pg(at)heroku(dot)com>, Ants Aasma <ants(at)cybertec(dot)at>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Clock sweep not caching enough B-Tree leaf pages?
Date: 2014-04-16 13:14:40
Message-ID: 20140416131440.GC16358@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2014-04-16 07:55:44 -0500, Merlin Moncure wrote:
> > 1. Bgwriter needs to be improved so that it can help in reducing
> > usage count and finding next victim buffer (run the clock sweep
> > and add buffers to the free list).
> > 2. SetLatch for bgwriter (wakeup bgwriter) when elements in freelist
> > are less.
> > 3. Split the workdone globallock (Buffreelist) in StrategyGetBuffer
> > (a spinlock for the freelist, and an lwlock for the clock sweep).
> > Here we can try to make it lock free based on atomic ops as
> > well.
> > 4. Bgwriter needs to be more aggressive, logic based on which it
> > calculates how many buffers it needs to process needs to be
> > improved.
> > 5. Contention around buffer mapping locks.
> > 6. Cacheline bouncing around the buffer header spinlocks, is there
> > anything we can do to reduce this?
> > 7. Choose Optimistically used buffer in StrategyGetBuffer().
> > 8. Don't bump the usage count every time buffer is pinned.
>
> What about: 9. Don't wait on locked buffer in the clock sweep.

I don't think we do that? Or are you referring to locked buffer headers?

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2014-04-16 13:16:40 Re: Question about optimising (Postgres_)FDW
Previous Message Andres Freund 2014-04-16 13:10:52 Re: bgworker crashed or not?