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 using all the system's consuming excessive system resources over a short period.

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

Environment load balancing and its settings are managed through the REST API endpoints listed in this document. Administrative users need to use these APIs to enable and configure environment load balancing, at a basic or advanced configuration.

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

  • To enable or disable environment load balancing, 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:

  • 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.