db icon indicating copy to clipboard operation
db copied to clipboard

Better default connection lifetime

Open mcandre opened this issue 6 years ago • 1 comments

upper overrides the driver default connection lifetime, but does so with zero, which is already the default for both database/sql and go-sql-driver/mysql:

https://github.com/upper/db/blob/master/settings.go#L185

If we're going to override this value, then could we use a more helpful default, such as 4 to 6 hours? This way, upper.io integrates better with (My)SQL servers, which tend to sever connections server-side every 8 hours of inactivity.

mcandre avatar Oct 08 '19 20:10 mcandre

As far as I understand, defaulting to 0 means connections will be reused:

https://golang.org/pkg/database/sql/#DB.SetConnMaxLifetime

Do you currently have any problems with short-lived sessions?

xiam avatar Oct 18 '19 21:10 xiam