spanner: change healthcheck interval to a longer time instead of every 5 mins #1817
Labels
api: spanner
Issues related to the Spanner API.
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
Client
spanner/v1.2.1
Expected behavior
The session will not be expired within an hour so that we don't need to check too frequent for keeping sessions alive. The health checks should be scheduled for every ~50 mins. However, in Go client library, the interval is a random value
time.Now() + [interval*0.5, interval*1.5)
so that we should set the health interval to 30 mins and the random range will become[15 mins, 45 mins)
.Actual behavior
The current health check is every 5 mins. This might overload the backend because of making too many GetSession() calls.
Related code
google-cloud-go/spanner/session.go
Lines 432 to 439 in 8f5ae45
google-cloud-go/spanner/session.go
Lines 1188 to 1199 in 3e5ef44
google-cloud-go/spanner/session.go
Lines 1235 to 1246 in 3e5ef44
The text was updated successfully, but these errors were encountered: