首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >go-redis/v8连接池超时

go-redis/v8连接池超时
EN

Stack Overflow用户
提问于 2021-10-28 03:30:52
回答 1查看 1.4K关注 0票数 0

**连接池**

代码语言:javascript
复制
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“,谢谢!!

EN

回答 1

Stack Overflow用户

发布于 2022-01-15 20:20:33

如果启用了ElastiCache上的TLS,您必须将TLSConfig添加到您的客户端选项中,并选择TLS版本,或者只留下一个空的结构就可以了,请让我知道它是否有效。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69747960

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档