0

** connection pool **

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)
    }

The connection pool will occasionally appear in use “connection pool timeout”

redis use "Amazon ElastiCache for Redis "

thanks!!

1 Answers1

0

If TLS on the ElastiCache is enabled you have to add TLSConfig into your client option and choose the TLS version or just leave it with an empty struct just be fine, Please let me know if it works or not

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 16 '22 at 10:53