Re: Why do we still have commit_delay and commit_siblings?

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: Why do we still have commit_delay and commit_siblings?
Дата
Msg-id 4FB0A673.7040002@enterprisedb.com
обсуждение исходный текст
Ответ на Why do we still have commit_delay and commit_siblings?  (Peter Geoghegan <peter@2ndquadrant.com>)
Ответы Re: Why do we still have commit_delay and commit_siblings?  (Simon Riggs <simon@2ndQuadrant.com>)
Список pgsql-hackers
On 14.05.2012 02:17, Peter Geoghegan wrote:
> One illuminating way of quickly explaining the new group commit code
> is that it also inserts a delay at approximately the same place (well,
> more places now, since the delay was previously inserted only at the
> xact.c callsite of XLogFlush(), and there are plenty more sites than
> that), only that delay is now just about perfectly adaptive. That
> isn't quite the full truth, since we *also* have the benefit of
> *knowing* that there is an active leader/flusher at all times we're
> delayed. The unusual semantics of LWLockAcquireOrWait() result in the
> new 9.2 code almost always just causing a delay for most backends when
> group commit matters (that is, a delay before they reach their final,
> "productive" iteration of the for(;;) loop for the commit, usually
> without them ever actually acquiring the exclusive
> lock/XlogWrite()'ing).

That doesn't seem like an accurate explanation of how the code works. It 
doesn't insert a deliberate delay anywhere. At a high level, the 
algorithm is exactly the same as before. However, the new code improves 
the concurrency of noticing that the WAL has been flushed. If you had a 
machine where context switches are infinitely fast and has zero 
contention from accessing shared memory, the old and new code would 
behave the same.

It was an impressive improvement, but the mechanism is completely 
different from commit_delay and commit_siblings.

That said, I wouldn't mind removing commit_delay and commit_siblings. 
They're pretty much impossible to tune correctly, assuming they work as 
advertised. Some hard data would be nice, though, as Robert suggested.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Why do we still have commit_delay and commit_siblings?
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Why do we still have commit_delay and commit_siblings?