Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@
* [CHANGE] Removed obsolete `results_cache.max_freshness` from YAML config (deprecated since Cortex 1.2). #3145
* [CHANGE] Removed obsolete `-promql.lookback-delta` option (deprecated since Cortex 1.2, replaced with `-querier.lookback-delta`). #3144
* [FEATURE] Logging of the source IP passed along by a reverse proxy is now supported by setting the `-server.log-source-ips-enabled`. For non standard headers the settings `-server.log-source-ips-header` and `-server.log-source-ips-regex` can be used. #2985
* [CHANGE] Cache: added support for Redis Cluster and Redis Sentinel. #2961
- The following changes have been made in Redis configuration:
- `-redis.master_name` added
- `-redis.db` added
- `-redis.max-active-conns` changed to `-redis.pool-size`
- `-redis.max-conn-lifetime` changed to `-redis.max-connection-age`
- `-redis.max-idle-conns` removed
- `-redis.wait-on-pool-exhaustion` removed
* [FEATURE] Experimental blocks storage: added shuffle sharding support to store-gateway blocks sharding. Added the following additional metrics to store-gateway: #3069
* `cortex_bucket_stores_tenants_discovered`
* `cortex_bucket_stores_tenants_synced`
Expand Down
30 changes: 14 additions & 16 deletions docs/configuration/config-file-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -2856,11 +2856,15 @@ The `redis_config` configures the Redis backend cache. The supported CLI flags `
 

```yaml
# Redis service endpoint to use when caching chunks. If empty, no redis will be
# used.
# Redis Server endpoint to use for caching. A comma-separated list of endpoints
# for Redis Cluster or Redis Sentinel. If empty, no redis will be used.
# CLI flag: -<prefix>.redis.endpoint
[endpoint: <string> | default = ""]

# Redis Sentinel master name. An empty string for Redis Server or Redis Cluster.
# CLI flag: -<prefix>.redis.master-name
[master_name: <string> | default = ""]

# Maximum time to wait before giving up on redis requests.
# CLI flag: -<prefix>.redis.timeout
[timeout: <duration> | default = 100ms]
Expand All @@ -2869,13 +2873,13 @@ The `redis_config` configures the Redis backend cache. The supported CLI flags `
# CLI flag: -<prefix>.redis.expiration
[expiration: <duration> | default = 0s]

# Maximum number of idle connections in pool.
# CLI flag: -<prefix>.redis.max-idle-conns
[max_idle_conns: <int> | default = 80]
# Database index.
# CLI flag: -<prefix>.redis.db
[db: <int> | default = 0]

# Maximum number of active connections in pool.
# CLI flag: -<prefix>.redis.max-active-conns
[max_active_conns: <int> | default = 0]
# Maximum number of connections in the pool.
# CLI flag: -<prefix>.redis.pool-size
[pool_size: <int> | default = 0]

# Password to use when connecting to redis.
# CLI flag: -<prefix>.redis.password
Expand All @@ -2890,16 +2894,10 @@ The `redis_config` configures the Redis backend cache. The supported CLI flags `
# CLI flag: -<prefix>.redis.idle-timeout
[idle_timeout: <duration> | default = 0s]

# Enables waiting if there are no idle connections. If the value is false and
# the pool is at the max_active_conns limit, the pool will return a connection
# with ErrPoolExhausted error and not wait for idle connections.
# CLI flag: -<prefix>.redis.wait-on-pool-exhaustion
[wait_on_pool_exhaustion: <boolean> | default = false]

# Close connections older than this duration. If the value is zero, then the
# pool does not close connections based on age.
# CLI flag: -<prefix>.redis.max-conn-lifetime
[max_conn_lifetime: <duration> | default = 0s]
# CLI flag: -<prefix>.redis.max-connection-age
[max_connection_age: <duration> | default = 0s]
```

### `memcached_config`
Expand Down
22 changes: 16 additions & 6 deletions docs/production/caching.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,20 +95,30 @@ See [`fifo_cache_config` documentation](../configuration/config-file-reference.m
You can also use [Redis](https://redis.io/) for out-of-process caching; this is a relatively new addition to Cortex and is under active development.

```
-<prefix>.redis.endpoint string
Redis endpoint to use when caching chunks. If empty, no redis will be used.
For Redis Server - Redis service endpoint
For Redis Cluster - comma-separated list of Redis node's endpoints
For Redis Sentinel - comma-separated list of Redis Sentinel endpoints
-<prefix>.redis.master-name
Redis Sentinel master group name.
An empty string for Redis Server or Redis Cluster
-<prefix>.redis.enable-tls
Enables connecting to redis with TLS.
-<prefix>.redis.endpoint string
Redis service endpoint to use when caching chunks. If empty, no redis will be used.
-<prefix>.redis.expiration duration
How long keys stay in the redis.
-<prefix>.redis.max-active-conns int
Maximum number of active connections in pool.
-<prefix>.redis.max-idle-conns int
Maximum number of idle connections in pool. (default 80)
-<prefix>.redis.db int
Database index. (default 0)
-<prefix>.redis.pool-size int
Maximum number of socket connections in pool.
-<prefix>.redis.password value
Password to use when connecting to redis.
-<prefix>.redis.timeout duration
Maximum time to wait before giving up on redis requests. (default 100ms)
-<prefix>.redis.idle-timeout duration
Amount of time after which client closes idle connections.
-<prefix>.redis.max-connection-age duration
Amount of time after which client closes connections.
```

See [`redis_config` documentation](../configuration/config-file-reference.md#redis-config) if you use a config file with Cortex.
Expand Down
8 changes: 5 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ require (
github.com/Masterminds/squirrel v0.0.0-20161115235646-20f192218cf5
github.com/NYTimes/gziphandler v1.1.1
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d
github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect
github.com/alicebob/miniredis v2.5.0+incompatible
github.com/armon/go-metrics v0.3.3
github.com/aws/aws-sdk-go v1.33.12
github.com/blang/semver v3.5.0+incompatible
Expand All @@ -20,13 +22,13 @@ require (
github.com/felixge/fgprof v0.9.1
github.com/fsouza/fake-gcs-server v1.7.0
github.com/go-kit/kit v0.10.0
github.com/go-redis/redis/v8 v8.0.0-beta.10.0.20200905143926-df7fe4e2ce72
github.com/gocql/gocql v0.0.0-20200526081602-cd04bd7f22a7
github.com/gogo/protobuf v1.3.1
github.com/gogo/status v1.0.3
github.com/golang-migrate/migrate/v4 v4.7.0
github.com/golang/protobuf v1.4.2
github.com/golang/snappy v0.0.1
github.com/gomodule/redigo v2.0.0+incompatible
github.com/gorilla/mux v1.7.3
github.com/grpc-ecosystem/go-grpc-middleware v1.1.0
github.com/hashicorp/consul/api v1.5.0
Expand All @@ -47,14 +49,14 @@ require (
github.com/prometheus/client_model v0.2.0
github.com/prometheus/common v0.11.1
github.com/prometheus/prometheus v1.8.2-0.20200819132913-cb830b0a9c78
github.com/rafaeljusto/redigomock v0.0.0-20190202135759-257e089e14a1
github.com/segmentio/fasthash v0.0.0-20180216231524-a72b379d632e
github.com/sony/gobreaker v0.4.1
github.com/spf13/afero v1.2.2
github.com/stretchr/testify v1.5.1
github.com/stretchr/testify v1.6.1
github.com/thanos-io/thanos v0.13.1-0.20200807203500-9b578afb4763
github.com/uber/jaeger-client-go v2.25.0+incompatible
github.com/weaveworks/common v0.0.0-20200820123129-280614068c5e
github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da // indirect
go.etcd.io/bbolt v1.3.5-0.20200615073812-232d8fc87f50
go.etcd.io/etcd v0.5.0-alpha.5.0.20200520232829-54ba9589114f
go.uber.org/atomic v1.6.0
Expand Down
Loading