Skip to content

Commit 4710609

Browse files
sshaderConvex, Inc.
authored andcommitted
Increase MySQL connection pool TTLs for funrun (#31367)
We've seen a ~40ms overhead when acquiring a new connection (as opposed to reusing an existing one). The current parameters try and keep the pool small but are from an era before funrun as well as before we were using RDS proxy. This makes it so that funrun keeps connections around for longer so we can benefit from connection reuse. GitOrigin-RevId: db9e30bcb89ab159bacfaccadf545d6b6547b9df
1 parent 474532b commit 4710609

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/common/src/knobs.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,8 @@ pub static MYSQL_MAX_QUERY_DYNAMIC_BATCH_SIZE: LazyLock<usize> =
799799
/// Close a connection after it has been idle for some time. RDS proxy closes
800800
/// connections after idle_client_timeout in mysql.tf, which should be
801801
/// configured to be higher than this.
802+
///
803+
/// This is overridden to 30 min in funrun
802804
pub static MYSQL_INACTIVE_CONNECTION_LIFETIME: LazyLock<Duration> = LazyLock::new(|| {
803805
Duration::from_secs(env_config("MYSQL_INACTIVE_CONNECTION_LIFETIME_SECS", 90))
804806
});
@@ -807,6 +809,8 @@ pub static MYSQL_INACTIVE_CONNECTION_LIFETIME: LazyLock<Duration> = LazyLock::ne
807809
/// connections if the SQL query which exceeded the 16384 byte limit. Having a
808810
/// hard limit on connection lifetime helps us reduce pinning and improve
809811
/// connection reuse.
812+
///
813+
/// This is overridden to 30 min in funrun
810814
pub static MYSQL_MAX_CONNECTION_LIFETIME: LazyLock<Duration> =
811815
LazyLock::new(|| Duration::from_secs(env_config("MYSQL_MAX_CONNECTION_LIFETIME_SECS", 600)));
812816

0 commit comments

Comments
 (0)