Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update in-memory results caching documentation #257

Merged
merged 3 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
16 changes: 9 additions & 7 deletions spiceaidocs/docs/features/caching/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Spice supports in-memory caching of query results.

Results caching can help improve performance for bursts of requests and for non-accelerated results such as refresh data returned [on zero results](/data-accelerators/data-refresh.md#behavior-on-zero-results).

Results caching employs a [least-recently-used (LRU)](https://en.wikipedia.org/wiki/Cache_replacement_policies#LRU) cache replacement policy with the ability to specific an item expiry duration which defaults to 1-second.
Results caching employs a [least-recently-used (LRU)](https://en.wikipedia.org/wiki/Cache_replacement_policies#LRU) cache replacement policy with the ability to specify an item expiry duration, which defaults to 1-second.

```yaml
version: v1beta1
Expand All @@ -21,14 +21,16 @@ name: app
runtime:
results_cache:
enabled: true
cache_max_size: 128mb
item_expire: 1s
cache_max_size: 128MiB
eviction_policy: lru
item_ttl: 1s
```

- `enabled` - optional, `true` by default (if there is a non-empty `results_cache` section defined)
- `cache_max_size` - optional, maximum cache size. Default is `128MB`
- `item_expire` - optional, cache entry expiration time, 1 second by default.
- `enabled` - optional, `true` by default
- `cache_max_size` - optional, maximum cache size. Default is `128MiB`
- `eviction_policy` - optional, cache replacement policy when the cached data reaches the `cache_max_size`. Default is `lru` - [least-recently-used (LRU)](https://en.wikipedia.org/wiki/Cache_replacement_policies#LRU)
- `item_ttl` - optional, cache entry expiration duration, 1 second by default.

:::warning[Limitations]
- Results caching for Arrow Flight queries is not currently supported (coming soon).
- Cache currently supports only the [least-recently-used (LRU)](https://en.wikipedia.org/wiki/Cache_replacement_policies#LRU) replacement policy.
y-f-u marked this conversation as resolved.
Show resolved Hide resolved
:::
12 changes: 7 additions & 5 deletions spiceaidocs/docs/reference/spicepod/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,15 @@ The results cache section specifies runtime cache configuration. [Learn more](/f
runtime:
results_cache:
enabled: true
cache_max_size: 128mb
item_expire: 1s
cache_max_size: 128MiB
eviction_policy: lru
item_ttl: 1s
```

- `enabled` - optional, `true` by default (if there is a non-empty `results_cache` section defined)
- `cache_max_size` - optional, maximum cache size. Default is `128MB`
- `item_expire` - optional, cache entry expiration time, 1 second by default.
- `enabled` - optional, `true` by default
- `cache_max_size` - optional, maximum cache size. Default is `128MiB`
- `eviction_policy` - optional, cache replacement policy when the cached data reaches the `cache_max_size`. Default is `lru` - [least-recently-used (LRU)](https://en.wikipedia.org/wiki/Cache_replacement_policies#LRU)
- `item_ttl` - optional, cache entry expiration time, 1 second by default.

## `metadata`

Expand Down