From 18cd15e706ac1f2d6b1c49847a82774ca143352f Mon Sep 17 00:00:00 2001 From: Melanie Plageman Date: Wed, 12 Mar 2025 11:33:08 -0400 Subject: 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 Reviewed-by: Bertrand Drouvot Reviewed-by: Fujii Masao Reviewed-by: Daniel Gustafsson Reviewed-by: Jacob Champion Reviewed-by: Jelte Fennema-Nio Reviewed-by: Guillaume Lelarge Discussion: https://postgr.es/m/flat/CAAKRu_b_smAHK0ZjrnL5GRxnAVWujEXQWpLXYzGbmpcZd3nLYw%40mail.gmail.com --- src/backend/utils/misc/postgresql.conf.sample | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/backend/utils/misc/postgresql.conf.sample') diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample index c291c05d181..d2bd329a587 100644 --- a/src/backend/utils/misc/postgresql.conf.sample +++ b/src/backend/utils/misc/postgresql.conf.sample @@ -580,7 +580,7 @@ #log_checkpoints = on #log_connections = '' # log aspects of connection setup # options include receipt, authentication, authorization, - # and all to log all of these aspects + # setup_durations, and all to log all of these aspects #log_disconnections = off #log_duration = off # log statement duration #log_error_verbosity = default # terse, default, or verbose messages -- cgit v1.2.3