Re: Patch: fix lock contention for HASHHDR.mutex

Поиск
Список
Период
Сортировка
Искать
От
Aleksander Alekseev
Тема
Re: Patch: fix lock contention for HASHHDR.mutex
Дата
Msg-id
20151217190342.07e4533a@fujitsu
Ответ на
Список
Дерево обсуждения
Patch: fix lock contention for HASHHDR.mutex Aleksander Alekseev <a.alekseev@postgrespro.ru>
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 Andres Freund <andres@anarazel.de>
Re: Patch: fix lock contention for HASHHDR.mutex Aleksander Alekseev <a.alekseev@postgrespro.ru>
Re: Patch: fix lock contention for HASHHDR.mutex Robert Haas <robertmhaas@gmail.com>
Re: Patch: fix lock contention for HASHHDR.mutex Aleksander Alekseev <a.alekseev@postgrespro.ru>
Re: Patch: fix lock contention for HASHHDR.mutex Aleksander Alekseev <a.alekseev@postgrespro.ru>
Re: Patch: fix lock contention for HASHHDR.mutex Andres Freund <andres@anarazel.de>
Re: Patch: fix lock contention for HASHHDR.mutex Aleksander Alekseev <a.alekseev@postgrespro.ru>
Re: Patch: fix lock contention for HASHHDR.mutex Teodor Sigaev <teodor@sigaev.ru>
Re: Patch: fix lock contention for HASHHDR.mutex Aleksander Alekseev <a.alekseev@postgrespro.ru>
Re: Patch: fix lock contention for HASHHDR.mutex Robert Haas <robertmhaas@gmail.com>
Re: Patch: fix lock contention for HASHHDR.mutex Aleksander Alekseev <a.alekseev@postgrespro.ru>
Re: Patch: fix lock contention for HASHHDR.mutex Robert Haas <robertmhaas@gmail.com>
Re: Patch: fix lock contention for HASHHDR.mutex Aleksander Alekseev <a.alekseev@postgrespro.ru>
Re: Patch: fix lock contention for HASHHDR.mutex Aleksander Alekseev <a.alekseev@postgrespro.ru>
Re: Patch: fix lock contention for HASHHDR.mutex Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Patch: fix lock contention for HASHHDR.mutex Andres Freund <andres@anarazel.de>
Re: Patch: fix lock contention for HASHHDR.mutex Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Patch: fix lock contention for HASHHDR.mutex Aleksander Alekseev <a.alekseev@postgrespro.ru>
Re: Patch: fix lock contention for HASHHDR.mutex Oleg Bartunov <obartunov@gmail.com>
--enable-depend by default (was Re: Patch: fix lock contention for HASHHDR.mutex) Tom Lane <tgl@sss.pgh.pa.us>
Re: --enable-depend by default (was Re: Patch: fix lock contention for HASHHDR.mutex) Andres Freund <andres@anarazel.de>
Re: --enable-depend by default (was Re: Patch: fix lock contention for HASHHDR.mutex) Greg Stark <stark@mit.edu>
Re: --enable-depend by default (was Re: Patch: fix lock contention for HASHHDR.mutex) Tom Lane <tgl@sss.pgh.pa.us>
Re: --enable-depend by default (was Re: Patch: fix lock contention for HASHHDR.mutex) Andres Freund <andres@anarazel.de>
Re: Patch: fix lock contention for HASHHDR.mutex Fabrízio de Royes Mello <fabriziomello@gmail.com>
Re: Patch: fix lock contention for HASHHDR.mutex Aleksander Alekseev <a.alekseev@postgrespro.ru>
Re: Patch: fix lock contention for HASHHDR.mutex Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Patch: fix lock contention for HASHHDR.mutex Aleksander Alekseev <a.alekseev@postgrespro.ru>
Re: Patch: fix lock contention for HASHHDR.mutex Dilip Kumar <dilipbalaut@gmail.com>
Re: Patch: fix lock contention for HASHHDR.mutex Aleksander Alekseev <a.alekseev@postgrespro.ru>
Re: Patch: fix lock contention for HASHHDR.mutex Dilip Kumar <dilipbalaut@gmail.com>
Re: Patch: fix lock contention for HASHHDR.mutex Aleksander Alekseev <a.alekseev@postgrespro.ru>
Re: Patch: fix lock contention for HASHHDR.mutex Dilip Kumar <dilipbalaut@gmail.com>
Re: Patch: fix lock contention for HASHHDR.mutex Andres Freund <andres@anarazel.de>
Re: Patch: fix lock contention for HASHHDR.mutex Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Patch: fix lock contention for HASHHDR.mutex Anastasia Lubennikova <a.lubennikova@postgrespro.ru>
Re: Patch: fix lock contention for HASHHDR.mutex Aleksander Alekseev <a.alekseev@postgrespro.ru>
Re: Patch: fix lock contention for HASHHDR.mutex Anastasia Lubennikova <a.lubennikova@postgrespro.ru>
Re: Patch: fix lock contention for HASHHDR.mutex Aleksander Alekseev <a.alekseev@postgrespro.ru>
Re: Patch: fix lock contention for HASHHDR.mutex Robert Haas <robertmhaas@gmail.com>
Re: Patch: fix lock contention for HASHHDR.mutex Aleksander Alekseev <a.alekseev@postgrespro.ru>
Re: Patch: fix lock contention for HASHHDR.mutex Robert Haas <robertmhaas@gmail.com>
Re: Patch: fix lock contention for HASHHDR.mutex Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Patch: fix lock contention for HASHHDR.mutex Aleksander Alekseev <a.alekseev@postgrespro.ru>
Re: Patch: fix lock contention for HASHHDR.mutex Robert Haas <robertmhaas@gmail.com>
Re: Patch: fix lock contention for HASHHDR.mutex Aleksander Alekseev <a.alekseev@postgrespro.ru>
Re: Patch: fix lock contention for HASHHDR.mutex Robert Haas <robertmhaas@gmail.com>
Re: Patch: fix lock contention for HASHHDR.mutex Robert Haas <robertmhaas@gmail.com>
Re: Patch: fix lock contention for HASHHDR.mutex Aleksander Alekseev <a.alekseev@postgrespro.ru>
Re: Patch: fix lock contention for HASHHDR.mutex Amit Kapila <amit.kapila16@gmail.com>
Re: Patch: fix lock contention for HASHHDR.mutex Aleksander Alekseev <a.alekseev@postgrespro.ru>
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>
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>
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>
Re: Patch: fix lock contention for HASHHDR.mutex Aleksander Alekseev <a.alekseev@postgrespro.ru>
Re: Patch: fix lock contention for HASHHDR.mutex Robert Haas <robertmhaas@gmail.com>
Re: Patch: fix lock contention for HASHHDR.mutex Aleksander Alekseev <a.alekseev@postgrespro.ru>
Re: Patch: fix lock contention for HASHHDR.mutex Robert Haas <robertmhaas@gmail.com>
Re: Patch: fix lock contention for HASHHDR.mutex Aleksander Alekseev <a.alekseev@postgrespro.ru>
Re: Patch: fix lock contention for HASHHDR.mutex Amit Kapila <amit.kapila16@gmail.com>
Re: Patch: fix lock contention for HASHHDR.mutex Aleksander Alekseev <a.alekseev@postgrespro.ru>
Re: Patch: fix lock contention for HASHHDR.mutex Amit Kapila <amit.kapila16@gmail.com>
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>
Re: Patch: fix lock contention for HASHHDR.mutex Aleksander Alekseev <a.alekseev@postgrespro.ru>
Re: Patch: fix lock contention for HASHHDR.mutex Amit Kapila <amit.kapila16@gmail.com>
Re: Patch: fix lock contention for HASHHDR.mutex Aleksander Alekseev <a.alekseev@postgrespro.ru>
Re: Patch: fix lock contention for HASHHDR.mutex Amit Kapila <amit.kapila16@gmail.com>
Re: Patch: fix lock contention for HASHHDR.mutex Tom Lane <tgl@sss.pgh.pa.us>
Re: Patch: fix lock contention for HASHHDR.mutex Aleksander Alekseev <a.alekseev@postgrespro.ru>
Re: Patch: fix lock contention for HASHHDR.mutex Aleksander Alekseev <a.alekseev@postgrespro.ru>
Re: Patch: fix lock contention for HASHHDR.mutex Simon Riggs <simon@2ndQuadrant.com>
Re: Patch: fix lock contention for HASHHDR.mutex Aleksander Alekseev <a.alekseev@postgrespro.ru>
> 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
Дата:
От: Tom Lane
Дата:
FAQ