Re: Patch: fix lock contention for HASHHDR.mutex

Поиск
Список
Период
Сортировка
От Aleksander Alekseev
Тема Re: Patch: fix lock contention for HASHHDR.mutex
Дата
Msg-id 20151217190342.07e4533a@fujitsu
обсуждение исходный текст
Ответ на Re: Patch: fix lock contention for HASHHDR.mutex  (Andres Freund <andres@anarazel.de>)
Ответы Re: Patch: fix lock contention for HASHHDR.mutex  (Robert Haas <robertmhaas@gmail.com>)
Re: Patch: fix lock contention for HASHHDR.mutex  (Amit Kapila <amit.kapila16@gmail.com>)
Список pgsql-hackers
> It'd really like to see it being replaced by a queuing lock
> (i.e. lwlock) before we go there. And then maybe partition the
> freelist, and make nentries an atomic.

I believe I just implemented something like this (see attachment). The
idea is to partition PROCLOCK hash table manually into NUM_LOCK_
PARTITIONS smaller and non-partitioned hash tables. Since these tables
are non-partitioned spinlock is not used and there is no lock
contention.

On 60-core server we gain 3.5-4 more TPS according to benchmark
described above. As I understand there is no performance degradation in
other cases (different CPU, traditional pgbench, etc).

If this patch seems to be OK I believe we could consider applying the
same change not only to PROCLOCK hash table.
Вложения

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

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: WIP: bloom filter in Hash Joins with batches
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Using a single standalone-backend run in initdb (was Re: Bootstrap DATA is a pita)