postgresql/src/include
Melanie Plageman 18cd15e706 Add connection establishment duration logging
Add log_connections option 'setup_durations' which logs durations of
several key parts of connection establishment and backend setup.

For an incoming connection, starting from when the postmaster gets a
socket from accept() and ending when the forked child backend is first
ready for query, there are multiple steps that could each take longer
than expected due to external factors. This logging provides visibility
into authentication and fork duration as well as the end-to-end
connection establishment and backend initialization time.

To make this portable, the timings captured in the postmaster (socket
creation time, fork initiation time) are passed through the
BackendStartupData.

Author: Melanie Plageman <melanieplageman@gmail.com>
Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@oss.nttdata.com>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Reviewed-by: Jacob Champion <jacob.champion@enterprisedb.com>
Reviewed-by: Jelte Fennema-Nio <postgres@jeltef.nl>
Reviewed-by: Guillaume Lelarge <guillaume.lelarge@dalibo.com>
Discussion: https://postgr.es/m/flat/CAAKRu_b_smAHK0ZjrnL5GRxnAVWujEXQWpLXYzGbmpcZd3nLYw%40mail.gmail.com
2025-03-12 11:35:27 -04:00
..
access nbtree: Make BTMaxItemSize into object-like macro. 2025-03-11 10:35:56 -04:00
archive Update copyright for 2025 2025-01-01 11:21:55 -05:00
backup Update copyright for 2025 2025-01-01 11:21:55 -05:00
bootstrap Update copyright for 2025 2025-01-01 11:21:55 -05:00
catalog Add WAL data to backend statistics 2025-03-11 09:04:11 +09:00
commands Add relallfrozen to pg_class 2025-03-03 11:18:05 -05:00
common Change relpath() et al to return path by value 2025-02-25 09:02:07 -05:00
datatype Avoid using timezone Asia/Manila in regression tests. 2025-01-20 15:47:53 -05:00
executor Show index search count in EXPLAIN ANALYZE, take 2. 2025-03-11 09:20:50 -04:00
fe_utils Get rid of O(N^2) script-parsing overhead in pgbench. 2025-02-27 10:53:38 -05:00
foreign Update copyright for 2025 2025-01-01 11:21:55 -05:00
jit Fix grammatical typos around possessive "its" 2025-01-29 14:39:14 +07:00
lib Add new StringInfo APIs to allow callers to specify the buffer size. 2025-01-11 08:23:46 +09:00
libpq backend libpq void * argument for binary data 2025-02-23 14:27:02 +01:00
mb Add pg_encoding_set_invalid() 2025-02-10 10:03:37 -05:00
nodes Improve EXPLAIN's display of window functions. 2025-03-11 11:19:54 -04:00
optimizer Expand virtual generated columns in the planner 2025-02-25 16:10:25 +09:00
parser Virtual generated columns 2025-02-07 09:46:59 +01:00
partitioning Fix incorrect #endif comment 2025-03-10 13:36:04 +13:00
pch Update copyright for 2025 2025-01-01 11:21:55 -05:00
port Fix comment about AVX-512 popcount support. 2025-01-22 14:11:37 -06:00
portability Update copyright for 2025 2025-01-01 11:21:55 -05:00
postmaster Modularize log_connections output 2025-03-12 11:35:21 -04:00
regex Update copyright for 2025 2025-01-01 11:21:55 -05:00
replication pg_logicalinspect: Fix possible crash when passing a directory path. 2025-03-11 09:56:40 -07:00
rewrite Eliminate code duplication in replace_rte_variables callbacks 2025-02-25 16:11:34 +09:00
snowball Update to latest Snowball sources. 2025-02-18 21:13:54 -05:00
statistics Remove redundant pg_set_*_stats() variants. 2025-02-25 16:15:47 -08:00
storage Make parallel nbtree index scans use an LWLock. 2025-03-08 11:10:14 -05:00
tcop Add connection establishment duration logging 2025-03-12 11:35:27 -04:00
tsearch Update copyright for 2025 2025-01-01 11:21:55 -05:00
utils Add connection establishment duration logging 2025-03-12 11:35:27 -04:00
.gitignore Use <stdint.h> and <inttypes.h> for c.h integers. 2024-12-04 15:05:38 +13:00
c.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
fmgr.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
funcapi.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
getopt_long.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
Makefile Use <stdint.h> and <inttypes.h> for c.h integers. 2024-12-04 15:05:38 +13:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00
miscadmin.h Add connection establishment duration logging 2025-03-12 11:35:27 -04:00
pg_config.h.in Add support for OAUTHBEARER SASL mechanism 2025-02-20 16:25:17 +01:00
pg_config_manual.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_getopt.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
pg_trace.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
pgstat.h Add WAL data to backend statistics 2025-03-11 09:04:11 +09:00
pgtar.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
pgtime.h Seek zone abbreviations in the IANA data before timezone_abbreviations. 2025-01-16 14:11:19 -05:00
port.h Avoid breaking SJIS encoding while de-backslashing Windows paths. 2025-01-29 14:24:36 -05:00
postgres.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
postgres_ext.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
postgres_fe.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
varatt.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
windowapi.h Update copyright for 2025 2025-01-01 11:21:55 -05:00