|"The parameter value is the interval in seconds between each keepalive ping. A keepalive ping will be sent to a backend server if the connection is idle and it has not been used within n seconds where n is greater than or equal to the value of connection_keepalive. The keepalive pings are only sent when the client executes a query."|
I think that the The keepalive pings are only sent when the client executes a query is counter intuitive.
In my opinion connection_keepalive should work especially when no queries are executed.