19
19
"github.com/juju/juju/cert"
22
// SocketTimeout should be long enough that
23
// even a slow mongo server will respond in that
24
// length of time. Since mongo servers ping themselves
25
// every 10 seconds, we use a value of just over 2
26
// ping periods to allow for delayed pings due to
27
// issues such as CPU starvation etc.
28
const SocketTimeout = 21 * time.Second
22
// SocketTimeout should be long enough that even a slow mongo server
23
// will respond in that length of time, and must also be long enough
24
// to allow for completion of heavyweight queries.
26
// Note: 1 minute is mgo's default socket timeout value.
28
// Also note: We have observed mongodb occasionally getting "stuck"
29
// for over 30s in the field.
30
const SocketTimeout = time.Minute
30
// defaultDialTimeout should be representative of
31
// the upper bound of time taken to dial a mongo
32
// server from within the same cloud/private network.
32
// defaultDialTimeout should be representative of the upper bound of
33
// time taken to dial a mongo server from within the same
34
// cloud/private network.
33
35
const defaultDialTimeout = 30 * time.Second
35
37
// DialOpts holds configuration parameters that control the