Anywhere Cache (original) (raw)

This page describes Anywhere Cache, a feature that provides an SSD-backed zonal read cache for Cloud Storage buckets. Anywhere Cache delivers on-demand cache capacity by automatically sizing the cache and available bandwidth to meet your needs. Because of its benefits, Anywhere Cache is particularly helpful for reducing the network costs associated with read-heavy workloads.

See Create and manage caches to learn how to create and manage caches in Anywhere Cache.

Overview

Anywhere Cache lets you create caches in the same zone as your workloads. When you create a cache in a zone, data read requests originating from the zone are processed by the cache instead of the bucket. Each cache serves clients within the same zone as the cache. Data will only be ingested into the cache from your bucket when that data is read by a VM that resides in the same zone as the cache. Metadata doesn't get cached and requests for object metadata are processed by the bucket instead of the cache.

When you create a cache for a bucket, the cache must be created in a zone within the location of your bucket. For example, if your bucket is located in the us-east1 region, you can create a cache in us-east1-b but notus-central1-c. If your bucket is located in the ASIA dual-region, you can create a cache in any zones that make up the asia-east1 and asia-southeast1regions. For a list of zones, see the Supported locations section of this document.

For each bucket, you can create one cache per zone. For example, if your bucket is located in the US multi-region and your Compute Engine VMs are running in the us-east1-b and us-central1-a zones, you could create a cache inus-east1-b and another cache in us-central1-a.

Anywhere Cache is a fully managed service and always returns consistent data.

Benefits

When you cache your data with Anywhere Cache, you get the following benefits:

For details about pricing, see Anywhere Cache pricing. For information about quotas, see Anywhere Cache quotas.

When should you use Anywhere Cache?

Anywhere Cache is best used to cache data that's infrequently changed and frequently read, such as data used to train ML models or run analytics workloads.

Say you're training an AI model across many Google Kubernetes Engine nodes, all repeatedly reading data that's stored in your Cloud Storage buckets and running in the same zone. When you create a cache in the zone where your workload is running, the cache provides extra bandwidth and helps you reduce the data transfer fees associated with reading data in multi-region buckets, letting you run larger, scaled workloads more efficiently.

Pricing

For pricing for using Anywhere Cache, see Anywhere Cache pricing.

Supported locations

Caches can be created in specific zones as long as capacity is available. If the capacity for creating a cache is unavailable, the Anywhere Cache service continues trying to create a cache until the capacity becomes available or the creation process is aborted by the user. The capacity might remain unavailable for a long period of time.

For each bucket, you can create a maximum of one cache per zone. For example, if a bucket is located in the us-east1 region, you could create a cache inus-east1-b and another cache in us-east1-c. If a bucket is located in a multi-region that encompasses us-central1 and us-east1, you could create a cache in us-central1-a and another cache in us-east1-b.

You can use Anywhere Cache in the following zones. These zones can be used depending on the location type of your bucket.

Geographic area Location
Zone name Region Dual-region Multi-region Custom dual-region
Asia
asia-east1-a
asia-east1-b
asia-east1-c
asia-northeast1-a
asia-northeast1-b
asia-northeast1-c
asia-south1-a
asia-south1-b
asia-south1-c
asia-southeast1-a
asia-southeast1-b
asia-southeast1-c
Europe
europe-north1-a
europe-north1-b
europe-north1-c
europe-west1-b
europe-west1-c
europe-west1-d
europe-west4-a
europe-west4-b
europe-west4-c
europe-west6-a
europe-west6-b
United States
us-central1-a
us-central1-b
us-central1-c
us-central1-f
us-east1-a
us-east1-b
us-east1-c
us-east1-d
us-east4-a
us-east4-b
us-east4-c
us-east5-a
us-east5-b
us-east5-c
us-south1-a
us-south1-b
us-south1-c
us-west1-a
us-west1-b
us-west1-c
us-west3-a
us-west3-b
us-west3-c
us-west4-a
us-west4-b
us-west4-c

Anywhere Cache recommender

The Anywhere Cache recommender provides recommendations and insights for creating caches in bucket-zone pairs by analyzing your data usage and storage. For overview information and instructions on using the Anywhere Cache recommender, see Anywhere Cache recommender.

Cache operations

This section describes operations you can perform on Anywhere Cache caches. Some operations are asynchronous and return along-running operation, while other operations are synchronous, where the operations are done immediately and return an AnywhereCache resource.

Create a cache

When you create a cache, you can configure the following properties:

When you create a cache, the cache enters a CREATING state as it's being created, and enters a RUNNING state when it becomes actively running. Cache creation operation can take up to 48 hours, after which, the operation times out.

The AnywhereCaches Create API is asynchronous. A create operation causes a long-running operation to be returned. The long-running operation provides a status of the create operation and lets you cancel the operation before it's complete.

Update a cache

You can update the TTL or admission policy of a cache in a _RUNNING_state. When a cache is in the process of being updated, the pending_updatefield evaluates to true. While the pending_update field evaluates to true, the cache cannot be updated again.

A cache in a CREATING, PAUSED, or DISABLED state cannot be updated. The AnywhereCaches Update API is asynchronous and returns a long-running operation.

When the TTL of a cache has finished updating, the new TTL immediately applies to newly ingested data, and only applies to existing data when that data is read. This means that existing data within the cache retains the old TTL until that data gets read, or is evicted due to the expiration of the TTL.

Get a cache

When you get a cache, Anywhere Cache returns the state and configuration of the cache instance. The AnywhereCaches Get API is synchronous and returns an AnywhereCache resource.

List caches

You can return a list of associated caches for a given bucket. The AnywhereCaches List API is synchronous and supports pagination.

Pause a cache

You can pause a cache to stop the data ingestion of a cache that's in a_RUNNING_ state. When a cache is in a PAUSED state, you can still read existing data from the cache but you can't ingest new data into the cache. Reading existing data from the cache resets the TTL of the data in the cache.

When you resume a cache in a PAUSED state, the cache enters a _RUNNING_state.

The AnywhereCaches Pause API is synchronous and returns an AnywhereCache resource.

Resume a cache

You can resume caches that are in a PAUSED state or a DISABLED state, as long as the disabled cache is within the 1-hour grace period. After the 1-hour grace period, the resume operation is done at best effort, as the cache could be deleted at any point after the grace period. Once a cache has been resumed, it enters a RUNNING state.

The AnywhereCaches Resume API is synchronous and returns an AnywhereCache resource.

Disable a cache

You can disable a cache to permanently remove the cache from your bucket's configuration. When you disable a cache, it enters a DISABLED state. During this state, you can still read existing data from the cache but you can't ingest new data into the cache.

After you disable a cache, there's a 1-hour grace period during which you can cancel the disablement by resuming the cache. After this 1-hour grace period, the cache gets deleted. When the cache gets deleted, all the data within the cache gets evicted, and the cache is removed from the bucket.

During the 1-hour period before the cache gets deleted, you can revert the_DISABLED_ state by resuming the cache, at which point the cache resumes in the_RUNNING_ state.

The AnywhereCaches Disable API is synchronous and returns an AnywhereCache resource.

Cache size and bandwidth limit autoscaling

Anywhere Cache provides temporary cache storage and bandwidth that scale up and down according to your needs. To learn more about size and bandwidth limits for Anywhere Cache, see Cloud Storage quotas & limits.

Cost controls

The following are several tips you can utilize to minimize the costs of running a cache:

Limitations and restrictions

Troubleshooting temporary resource shortages

The following sections describe how to troubleshoot when a temporary resource shortage occurs, where there isn't enough SSD capacity or serving capacity in a specified zone to create a cache, increase a cache's size, or increase a cache's bandwidth limit.

Failure to create a new cache

Anywhere Cache can fail to create a new cache in a specific zone due either to a lack of SSD capacity or throughput serving resources, which results in a temporary shortage of resources. During this time period, Anywhere Cache attempts to create the new cache for up to 48 hours. If resources become available within the 48 hour timeframe, Anywhere Cache completes the cache creation request successfully. If resources don't become available within the 48 hour timeframe, the cache creation request fails.

How to troubleshoot: To avoid disruption to your caching, you can manually cancel the cache creation operation and create a new cache in a different zone that might have capacity available. To monitor or cancel a cache creation operation, seeusing long-running operations.

Failure to increase cache size

Anywhere Cache can fail to increase a cache's size when the required amount of SSD capacity isn't available in the cache's zone.

Although Anywhere Cache offers automatic cache size increases on-demand, cache size increases are contingent upon SSD capacity availability. If SSD capacity isn't available when the automatic cache size increase request is made, Anywhere Cache continues to submit the request until the temporary resource shortage ends or an increase in cache size is no longer needed.

During a temporary resource shortage, new data is ingested and existing data in the cache is evicted based on a least-recently-used basis. Caches that are large enough to store most of the hot data experience little to no impact to cache metrics. Caches with less capacity than the amount of hot data can evict data and re-ingest the same data more often than caches not affected by resource shortages. When the actual size of your cache is much smaller than the needed capacity, you might experience the following resource shortage-related behavior:

For information about these fees, seeAnywhere Cache pricing.

How to troubleshoot: For best results during a temporary resource shortage, we recommend monitoring your caches and pausing unnecessary caches or workloads based on your needs.

Failure to scale up a cache's bandwidth limit

A cache bandwidth limit shortage can occur temporarily during a cache size increase when throughput serving resources in a specific zone are insufficient to scale the cache bandwidth limit of existing caches at 20 Gbps per TiB. During a shortage available of cache bandwidth, Anywhere Cache doesn't allow the cache bandwidth limit to scale at 20 Gbps per TiB of data but the cache continues to serve read requests. Requests for a cache bandwidth limit increase are evaluated on a per-request basis. During a shortage of available cache bandwidth, you might see an increase in your bucket's data egress bandwidth consumption.

How to troubleshoot: For best results during a temporary resource shortage, we recommend monitoring your caches and pausing unnecessary caches or workloads based on your needs.

What's next