Set conns value to 128

pull/19/head
maru 6 months ago
parent 568697bc1f
commit 4cc2d3431c
No known key found for this signature in database
GPG Key ID: 37689350E9CD0F0D

@ -36,10 +36,7 @@ func Init(username, password, protocol, address, database string) error {
return fmt.Errorf("failed to open database connection: %s", err) return fmt.Errorf("failed to open database connection: %s", err)
} }
conns := 1024 conns := 128
if protocol != "unix" {
conns = 256
}
handle.SetMaxOpenConns(conns) handle.SetMaxOpenConns(conns)
handle.SetMaxIdleConns(conns / 4) handle.SetMaxIdleConns(conns / 4)

Loading…
Cancel
Save