Re: slow startup due to LWLockAssign() spinlock

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: slow startup due to LWLockAssign() spinlock
Дата
Msg-id 20140416233352.GR7443@momjian.us
обсуждение исходный текст
Ответ на Re: slow startup due to LWLockAssign() spinlock  (Andres Freund <andres@2ndquadrant.com>)
Ответы Re: slow startup due to LWLockAssign() spinlock  (Andres Freund <andres@2ndquadrant.com>)
Список pgsql-hackers
On Tue, Feb  4, 2014 at 12:58:49AM +0100, Andres Freund wrote:
> On 2014-02-03 11:22:45 -0500, Tom Lane wrote:
> > Andres Freund <andres@2ndquadrant.com> writes:
> > > On larger, multi-socket, machines, startup takes a fair bit of time. As
> > > I was profiling anyway I looked into it and noticed that just about all
> > > of it is spent in LWLockAssign() called by InitBufferPool(). Starting
> > > with shared_buffers=48GB on the server Nate Boley provided, takes about
> > > 12 seconds. Nearly all of it spent taking the ShmemLock spinlock.
> > > Simply modifying LWLockAssign() to not take the spinlock when
> > > !IsUnderPostmaster speeds it up to 2 seconds. While certainly not making
> > > LWLockAssign() prettier it seems enough of a speedup to be worthwile
> > > nonetheless.
> > 
> > Hm.  This patch only works if the postmaster itself never assigns any
> > LWLocks except during startup.  That's *probably* all right, but it
> > seems a bit scary.  Is there any cheap way to make the logic actually
> > be what your comment claims, namely "Interlocking is not necessary during
> > postmaster startup"?  I guess we could invent a ShmemInitInProgress global
> > flag ...
> 
> So, here's a flag implementing things with that flag. I kept your name,
> as it's more in line with ipci.c's naming, but it looks kinda odd
> besides proc_exit_inprogress.

Uh, where are we on this?

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + Everyone has their own god. +



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Clock sweep not caching enough B-Tree leaf pages?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Include planning time in EXPLAIN ANALYZE output.