Manage environment load balancing

Supported in:

This document explains how you can use environment load balancing to help maintain platform stability and ensure fair resource distribution, especially in multi-tenant environments. It aims to prevent any single, heavy-loaded environment from consuming excessive system resources over a short period of time.

To ensure balanced resource allocation across the platform, a lottery algorithm randomly selects environments.

Administrators can also prioritize certain environments by assigning them higher weights in the lottery algorithm, ensuring that they receive sufficient resources even during periods of high load.

Configure environment load balancing

The APIs in this document are categorized by their migration status:

  • Legacy API endpoints: used by environments that have not yet migrated.
  • Chronicle API endpoints: used by environments after migration.

For more information on the migration, see Migrate to Google Cloud.

Environment load balancing and its settings are managed through the REST API endpoints described in this document. While some existing APIs transitioning to new Chronicle API endpoints, some legacy endpoints remain available. Administrative users must use these APIs to enable and configure environment load balancing, at a basic or advanced configuration level.

Once enabled, the system uses a lottery algorithm to allocate resources. Each active environment receives tickets. By default, all environments receive an equal number of tickets. The system randomly selects winning tickets, and the corresponding environments are granted access to system resources for task processing.

This randomized approach ensures fair and balanced resource distribution across all environments.

Basic configuration: enable or disable environment load balancing

The API for enabling or disabling environment load balancing is a legacy endpoint. To enable or disable this feature, use the following API:

POST /api/external/v1/settings/toggle-environment-load-balancing

Advanced configuration: environment weights and prioritization

Use the following APIs to manage the weights assigned to individual environments. Chronicle API endpoints are available and recommended for the following operations.

Use these APIs for managing environment weights:

  • To reset the weights of all environments to their default:
    POST /projects/{project}/locations/{location}/instances/{instance}/environments:resetWeights
  • To view the weight of all environments:
    GET /projects/{project}/locations/{location}/instances/{instance}/environments
  • To view the weight of a specific environment:
    GET /projects/{project}/locations/{location}/instances/{instance}/environments/{environment}
  • To set the weight of a specific environment, replace {environment} with the environment_ID, and adjust the weight value in the request body:
    PATCH /projects/{project}/locations/{location}/instances/{instance}/environments/{environment}

    Request Body example:

    
    {
      "weight": 5
    }
    

Legacy API endpoints (deprecated)

  • To reset the weights of all environments to their default (equal weight), use the following API:
    POST /api/external/v1/settings/reset-environment-priorities
  • To view the weight of all environments, use the following API:
    GET /api/external/v1/settings/environment-priorities
  • To view the weight of a specific environment, replace {environment} with the environment_ID, and use the following API:
    GET /api/external/v1/settings/environment-priorities/{environment}
  • To set the weight of a specific environment, replace {environment} with the environment_ID, update the weight value in the request body, and use the following API:
    PATCH /api/external/v1/settings/environment-priorities/{environment}

    Request Body example:

    
    {
      "weight": 3
    }
    

Need more help? Get answers from Community members and Google SecOps professionals.