**连接池**
client := redis.NewClient(&redis.Options{
Addr: "Amazon ElastiCache for Redis ",
Password: "", // no password set
DB: 0, // use default DB
IdleCheckFrequency: 15*time.Second,
IdleTimeout:60*time.Second,
MinIdleConns: 15,
MaxConnAge: 60*time.Second,
})
var RedisCtx = context.Background()
_, err:=client.Exists(RedisCtx,key).Result()
if err!=nil{
//Random reminder connection pool timeout. why?
logs.Warning("exists redis error",err)
}连接池偶尔会出现在使用“连接池超时”,使用"Amazon“,谢谢!!
发布于 2022-01-15 20:20:33
如果启用了ElastiCache上的TLS,您必须将TLSConfig添加到您的客户端选项中,并选择TLS版本,或者只留下一个空的结构就可以了,请让我知道它是否有效。
https://stackoverflow.com/questions/69747960
复制相似问题