Reducing connection overhead in pg_upgrade compat check phase

Поиск
Список
Период
Сортировка
Искать
От
Daniel Gustafsson
Тема
Reducing connection overhead in pg_upgrade compat check phase
Дата
Msg-id
BBB4C76F-D416-4F9F-949E-DBE950D37787@yesql.se
Список
Дерево обсуждения
Reducing connection overhead in pg_upgrade compat check phase Daniel Gustafsson <daniel@yesql.se>
Re: Reducing connection overhead in pg_upgrade compat check phase Nathan Bossart <nathandbossart@gmail.com>
Re: Reducing connection overhead in pg_upgrade compat check phase Nathan Bossart <nathandbossart@gmail.com>
Re: Reducing connection overhead in pg_upgrade compat check phase Daniel Gustafsson <daniel@yesql.se>
Re: Reducing connection overhead in pg_upgrade compat check phase Nathan Bossart <nathandbossart@gmail.com>
Re: Reducing connection overhead in pg_upgrade compat check phase Daniel Gustafsson <daniel@yesql.se>
Re: Reducing connection overhead in pg_upgrade compat check phase Daniel Gustafsson <daniel@yesql.se>
Re: Reducing connection overhead in pg_upgrade compat check phase Nathan Bossart <nathandbossart@gmail.com>
Re: Reducing connection overhead in pg_upgrade compat check phase Nathan Bossart <nathandbossart@gmail.com>
Re: Reducing connection overhead in pg_upgrade compat check phase Daniel Gustafsson <daniel@yesql.se>
Re: Reducing connection overhead in pg_upgrade compat check phase Nathan Bossart <nathandbossart@gmail.com>
Re: Reducing connection overhead in pg_upgrade compat check phase Daniel Gustafsson <daniel@yesql.se>
Re: Reducing connection overhead in pg_upgrade compat check phase Nathan Bossart <nathandbossart@gmail.com>
Re: Reducing connection overhead in pg_upgrade compat check phase Daniel Gustafsson <daniel@yesql.se>
Re: Reducing connection overhead in pg_upgrade compat check phase Daniel Gustafsson <daniel@yesql.se>
Re: Reducing connection overhead in pg_upgrade compat check phase Nathan Bossart <nathandbossart@gmail.com>
Re: Reducing connection overhead in pg_upgrade compat check phase Daniel Gustafsson <daniel@yesql.se>
Re: Reducing connection overhead in pg_upgrade compat check phase Peter Eisentraut <peter@eisentraut.org>
Re: Reducing connection overhead in pg_upgrade compat check phase Daniel Gustafsson <daniel@yesql.se>
Re: Reducing connection overhead in pg_upgrade compat check phase Daniel Gustafsson <daniel@yesql.se>
Re: Reducing connection overhead in pg_upgrade compat check phase vignesh C <vignesh21@gmail.com>
Re: Reducing connection overhead in pg_upgrade compat check phase vignesh C <vignesh21@gmail.com>
Re: Reducing connection overhead in pg_upgrade compat check phase Nathan Bossart <nathandbossart@gmail.com>
Re: Reducing connection overhead in pg_upgrade compat check phase Daniel Gustafsson <daniel@yesql.se>
Re: Reducing connection overhead in pg_upgrade compat check phase Daniel Gustafsson <daniel@yesql.se>
Re: Reducing connection overhead in pg_upgrade compat check phase Peter Eisentraut <peter@eisentraut.org>
Re: Reducing connection overhead in pg_upgrade compat check phase Daniel Gustafsson <daniel@yesql.se>
Re: Reducing connection overhead in pg_upgrade compat check phase Daniel Gustafsson <daniel@yesql.se>
Re: Reducing connection overhead in pg_upgrade compat check phase Daniel Gustafsson <daniel@yesql.se>
Re: Reducing connection overhead in pg_upgrade compat check phase Daniel Gustafsson <daniel@yesql.se>
Re: Reducing connection overhead in pg_upgrade compat check phase Peter Eisentraut <peter@eisentraut.org>
Re: Reducing connection overhead in pg_upgrade compat check phase Daniel Gustafsson <daniel@yesql.se>
Re: Reducing connection overhead in pg_upgrade compat check phase Nathan Bossart <nathandbossart@gmail.com>
Re: Reducing connection overhead in pg_upgrade compat check phase Justin Pryzby <pryzby@telsasoft.com>
When adding a check to pg_upgrade a while back I noticed in a profile that the
cluster compatibility check phase spend a lot of time in connectToServer.  Some
of this can be attributed to data type checks which each run serially in turn
connecting to each database to run the check, and this seemed like a place
where we can do better.

The attached patch moves the checks from individual functions, which each loops
over all databases, into a struct which is consumed by a single umbrella check
where all data type queries are executed against a database using the same
connection.  This way we can amortize the connectToServer overhead across more
accesses to the database.

In the trivial case, a single database, I don't see a reduction of performance
over the current approach.  In a cluster with 100 (empty) databases there is a
~15% reduction in time to run a --check pass.  While it won't move the earth in
terms of wallclock time, consuming less resources on the old cluster allowing
--check to be cheaper might be the bigger win.

--
Daniel Gustafsson

В списке pgsql-hackers по дате отправления
От: Andres Freund
Дата:
От: Nathan Bossart
Дата:
Сообщение: archive modules loose ends
FAQ