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
5 changes: 5 additions & 0 deletions .changesets/config_geal_raise_redis_timeouts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Increase default Redis timeout ([PR #5795](https://github.com/apollographql/router/pull/5795))

The default Redis command timeout was increased from 2ms to 500ms to accommodate common production use cases.

By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/5795
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ serde_json_bytes = { version = "0.2.4", features = ["preserve_order"] }
sha1 = "0.10.6"
tempfile = "3.10.1"
tokio = { version = "1.36.0", features = ["full"] }
tower = { version = "0.4.13", features = ["full"] }
tower = { version = "0.4.13", features = ["full"] }
2 changes: 1 addition & 1 deletion apollo-router/src/cache/redis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ impl RedisCacheStorage {
let client = RedisClient::new(
client_config,
Some(PerformanceConfig {
default_command_timeout: config.timeout.unwrap_or(Duration::from_millis(2)),
default_command_timeout: config.timeout.unwrap_or(Duration::from_millis(500)),
..Default::default()
}),
None,
Expand Down
4 changes: 2 additions & 2 deletions docs/source/configuration/distributed-caching.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ supergraph:
urls: ["redis://..."] #highlight-line
username: admin/123 # Optional, can be part of the urls directly, mainly useful if you have special character like '/' in your password that doesn't work in url. This field takes precedence over the username in the URL
password: admin # Optional, can be part of the urls directly, mainly useful if you have special character like '/' in your password that doesn't work in url. This field takes precedence over the password in the URL
timeout: 5ms # Optional, by default: 2ms
timeout: 2s # Optional, by default: 500ms
ttl: 24h # Optional
namespace: "prefix" # Optional
#tls:
Expand All @@ -141,7 +141,7 @@ supergraph:

#### Timeout

Connecting and sending commands to Redis are subject to a timeout, set by default to 2ms, that can be overriden.
Connecting and sending commands to Redis are subject to a timeout, set by default to 500ms, that can be overriden.


#### TTL
Expand Down
2 changes: 1 addition & 1 deletion docs/source/configuration/entity-caching.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ preview_entity_cache:
# Configure Redis
redis:
urls: ["redis://..."]
timeout: 5ms # Optional, by default: 2ms
timeout: 2s # Optional, by default: 500ms
ttl: 24h # Optional, by default no expiration
# Configure entity caching per subgraph, overrides options from the "all" section
subgraphs:
Expand Down