Rapid Cache recommendations and insights

The Rapid Cache recommender analyzes your data usage and storage to provide recommendations that help you identify bucket-zone pairs in which it might be beneficial to create a cache using Rapid Cache. Rapid Cache also provides insights to show evidence for the recommendations. This page provides an overview of the Rapid Cache recommender and describes how to view recommendations and view insights.

Overview

Rapid Cache provides an SSD-backed zonal read cache for Cloud Storage buckets. To help you decide where to set up a cache and what time to live (TTL) to use, the Rapid Cache recommender provides recommendations for creating caches in bucket-zone pairs.

Reviewing and taking actions on cache recommendations can help you save on network data transfer fees, improve latencies, and avoid exceeding bandwidth quotas.

How it works

The Rapid Cache recommender simulates the existence of a cache and analyzes the cacheability and cost of your data over the past seven days by using the following insights:

The Rapid Cache recommender recommends a zone-bucket pair when the maximum cache size exceeds 100 GiB and one or more of the following three criteria are met:

These criteria are set so you only get recommendations for creating caches that are likely to provide significant benefit. Workloads that don't meet these criteria might also have significant benefits from having a cache, so you might want to set your own criteria. You can set your own criteria by exporting the recommendations to BigQuery and then querying the data using the values you want.

Recommendations include the zone name, the recommended time to live (TTL) of the cache, and the data ingestion behavior of the cache.

Pricing

Refer to Recommender pricing.

Before you begin

Before you begin, complete the following steps.

Enable the Recommender API

Enable the Recommender API.

Get required roles

To view recommendations and insights for Rapid Cache, ask your administrator to grant you the Storage Admin (roles/storage.admin) role on the bucket or project.

This role provides a set of permissions that let you view recommendations and insights for Rapid Cache. To see the exact permissions that are required, expand the Required permissions section:

Required permissions

  • recommender.storageBucketAnywhereCacheRecommendations.get
  • recommender.storageBucketAnywhereCacheRecommendations.list
  • recommender.storageBucketAnywhereCacheSimulationInsights.get
  • recommender.storageBucketAnywhereCacheSimulationInsights.list

For instructions on granting roles, see Use IAM with buckets or Managing access to projects.

View Rapid Cache recommendations

Console

To view recommendations for a specific bucket, complete the following steps:

  1. In the Google Cloud console, go to the Cloud Storage Buckets page.

    Go to Buckets

    In the list of buckets that appear, available recommendations appear in the Cache column. If recommendations are available, a Recommended button is displayed.

    If the Cache column doesn't appear by default, see Show columns for instructions on making the Cache column appear.

  2. To view details about a recommendation, click Recommended from the Cache column.

    A pane appears showing details about how enabling caching could affect performance and costs for the bucket, as well as the recommended cache settings for the bucket.

    To view all available recommendations for buckets within a project, filter the list of buckets by the Cache column. For instructions, see Filtering.

    In addition to viewing recommendations in the Cloud Storage portion of the Google Cloud console, you can also find Rapid Cache recommendations in the Active Assist. For details, see Find recommendations with the Active Assist.

REST API

JSON API

Have gcloud CLI installed and initialized, which lets you generate an access token for the Authorization header.

  • To list recommendations for the project where you've enabled the Recommender API, use cURL to call the Recommender API with a recommendations.list request.

  •   curl \
    -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    "https://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/\
    recommenders/google.storage.bucket.AnywhereCacheRecommender/recommendations"
    

    Replace the following:

    You can export recommendations to BigQuery using the BigQuery Data Transfer Service. For more information, see Export recommendations to BigQuery.

    View Rapid Cache insights

    The Rapid Cache recommender generates recommendations based on resource insights.

    Console

    To view insights for a specific bucket, complete the following steps:

    1. In the Google Cloud console, go to the Cloud Storage Buckets page.

      Go to Buckets

    2. Click the name of the bucket you want to view the insights of.

    3. In the Bucket details page, click the Configuration tab.

      In the Anywhere Cache section, a Recommended button appears when there are available recommendations to view. A Configure Cache button appears when there are no available recommendations to view and a cache is yet to be created for the bucket.

    4. In the Anywhere Cache section, click Recommended or Configure Cache.

      The Configure cache page appears. In the Recommendation column, a View insight button is displayed when there are available insights to view.

    5. In the Recommendation column, click View insight to view available insights for a cache-zone pair.

      The Caching analysis pane appears and displays insights for the cache-zone pair.

    Command line

    Have gcloud CLI installed and initialized, which lets you generate an access token for the Authorization header.
  • In your development environment, list Rapid Cache insights by using the gcloud recommender insights list command:

    gcloud recommender insights list --project=PROJECT_ID \
    --location=LOCATION --insight-type=INSIGHT_TYPE
    

    Replace the following:

  • REST API

    JSON API

    Have gcloud CLI installed and initialized, which lets you generate an access token for the Authorization header.

  • To list insights for the project where you've enabled the Recommender API, use cURL to call the Recommender API with an insights.list request.

  •   curl \
    -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    "https://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/\
    insightTypes/google.storage.bucket.AnywhereCacheSimulationInsight/insights"
    

    Replace the following:

    What's next