diff --git a/kvs/mysql/main.go b/kvs/mysql/main.go index 3f7b56c0..3a25ddc6 100644 --- a/kvs/mysql/main.go +++ b/kvs/mysql/main.go @@ -15,6 +15,8 @@ package mysql import ( + "time" + "strings" "crypto/tls" @@ -68,6 +70,20 @@ func init() { return } + // Set the maximum connection lifetime + + pntr.SetConnMaxLifetime(1 * time.Hour) + + // Set the max number of idle connections + + pntr.SetMaxIdleConns(350) + + // Set the max number of open connections + + pntr.SetMaxOpenConns(350) + + // Return the database pointer + return &DB{pntr: pntr}, err })