From e25d2288a1775f9b4511f50e3ceba331321dc47a Mon Sep 17 00:00:00 2001 From: sgrebnov Date: Wed, 22 May 2024 21:07:54 -0700 Subject: [PATCH 1/3] Update caching documentation --- spiceaidocs/docs/features/caching/index.md | 16 +++++++++------- spiceaidocs/docs/reference/spicepod/index.md | 12 +++++++----- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/spiceaidocs/docs/features/caching/index.md b/spiceaidocs/docs/features/caching/index.md index bfb853bb..87a7ff50 100644 --- a/spiceaidocs/docs/features/caching/index.md +++ b/spiceaidocs/docs/features/caching/index.md @@ -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 @@ -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. ::: \ No newline at end of file diff --git a/spiceaidocs/docs/reference/spicepod/index.md b/spiceaidocs/docs/reference/spicepod/index.md index a53d0ad0..c1926a2a 100644 --- a/spiceaidocs/docs/reference/spicepod/index.md +++ b/spiceaidocs/docs/reference/spicepod/index.md @@ -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` From 640af4b05d9e40775eb710d707ffcef37dcc06bb Mon Sep 17 00:00:00 2001 From: sgrebnov Date: Sun, 26 May 2024 13:00:32 -0700 Subject: [PATCH 2/3] Update `eviction_policy` details --- spiceaidocs/docs/features/caching/index.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/spiceaidocs/docs/features/caching/index.md b/spiceaidocs/docs/features/caching/index.md index 87a7ff50..1cbc7155 100644 --- a/spiceaidocs/docs/features/caching/index.md +++ b/spiceaidocs/docs/features/caching/index.md @@ -28,9 +28,5 @@ runtime: - `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) +- `eviction_policy` - optional, cache replacement policy when the cached data reaches the `cache_max_size`. Default and only currently supported value 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] -- Cache currently supports only the [least-recently-used (LRU)](https://en.wikipedia.org/wiki/Cache_replacement_policies#LRU) replacement policy. -::: \ No newline at end of file From 2011e14fc95cf1eb6b3b509e1ea3e2b3a334ad10 Mon Sep 17 00:00:00 2001 From: Sergei Grebnov Date: Sun, 26 May 2024 13:19:40 -0700 Subject: [PATCH 3/3] Update --- spiceaidocs/docs/features/caching/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spiceaidocs/docs/features/caching/index.md b/spiceaidocs/docs/features/caching/index.md index 1cbc7155..c039e98d 100644 --- a/spiceaidocs/docs/features/caching/index.md +++ b/spiceaidocs/docs/features/caching/index.md @@ -7,7 +7,7 @@ pagination_prev: null pagination_next: null --- -Spice supports in-memory caching of query results. +Spice supports in-memory caching of query results, which is enabled by default for both the HTTP (`/v1/sql`) and Arrow Flight APIs. 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).