File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -243,6 +243,13 @@ struct pool_params
243243 * Pings will be sent with a periodicity of `ping_interval` until the connection
244244 * is handed to the user, or a ping fails.
245245 *
246+ * Health checks serve two purposes:
247+ *
248+ * \li They prevent connections from closing during period of no activity.
249+ * \li They detect network errors and trigger reconnection. Without health checks,
250+ * you may be handed over connections that are no longer functional, but
251+ * haven't been diagnosed yet.
252+ *
246253 * Set this interval to zero to disable pings.
247254 *
248255 * This value must not be negative. It should be smaller than the server's
@@ -252,7 +259,7 @@ struct pool_params
252259 * session variable). Otherwise, the server might close connections
253260 * without the pool detecting it.
254261 */
255- std::chrono::steady_clock::duration ping_interval{std::chrono::hours ( 1 )};
262+ std::chrono::steady_clock::duration ping_interval{std::chrono::seconds ( 10 )};
256263
257264 /* *
258265 * \brief The timeout to use for pings and session resets.
You can’t perform that action at this time.
0 commit comments