SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
better mysql connection pool management
LazyDBA247-Anyvision8eed763b97ac
diff --git a/weed/command/scaffold.go b/weed/command/scaffold.goindex f43a9d143c..887c9883f7 100644--- a/weed/command/scaffold.go+++ b/weed/command/scaffold.go@@ -118,6 +118,7 @@ password = ""database = "" # create or use an existing databaseconnection_max_idle = 2connection_max_open = 100+connection_max_lifetime_seconds = 0interpolateParams = false[postgres] # or cockroachdbdiff --git a/weed/filer/mysql/mysql_store.go b/weed/filer/mysql/mysql_store.goindex 5bc1329800..62b9b287a2 100644--- a/weed/filer/mysql/mysql_store.go+++ b/weed/filer/mysql/mysql_store.go@@ -35,12 +35,13 @@ func (store *MysqlStore) Initialize(configuration util.Configuration, prefix strconfiguration.GetString(prefix+"database"),configuration.GetInt(prefix+"connection_max_idle"),configuration.GetInt(prefix+"connection_max_open"),+ configuration.GetInt(prefix+"connection_max_lifetime_seconds"),configuration.GetBool(prefix+"interpolateParams"),)}-func (store *MysqlStore) initialize(user, password, hostname string, port int, database string, maxIdle, maxOpen int,- interpolateParams bool) (err error) {+func (store *MysqlStore) initialize(user, password, hostname string, port int, database string, maxIdle, maxOpen,+ maxLifetimeSeconds int, interpolateParams bool) (err error) {//store.SqlInsert = "INSERT INTO filemeta (dirhash,name,directory,meta) VALUES(?,?,?,?)"store.SqlUpdate = "UPDATE filemeta SET meta=? WHERE dirhash=? AND name=? AND directory=?"@@ -65,6 +66,7 @@ func (store *MysqlStore) initialize(user, password, hostname string, port int, dstore.DB.SetMaxIdleConns(maxIdle)store.DB.SetMaxOpenConns(maxOpen)+ store.DB.SetConnMaxLifetime(maxLifetimeSeconds*time.Second)if err = store.DB.Ping(); err != nil {return fmt.Errorf("connect to %s error:%v", sqlUrl, err)