Resource Groups Autoscaling Examples

This section provides a few examples of setting up user limits on autoscaling through Resource Groups in Presto. Resource Groups based Dynamic Cluster Sizing in Presto describes the dynamic cluster sizing in detail.

Let us consider an organization with the following structure.

../../../_images/RGOrgStructure.png

For the above organization, the Presto configuration would be as below.

../../../_images/RGClusterOverride.png

Let consider another organization with user level limits that has the following structure.

../../../_images/RGuserlimits.png

The Presto configuration is the same that is used in the above example except that the resource group configuration would differ as mentioned below.

resource-groups.properties:
resource-groups.configuration-manager=file
resource-groups.config-file=etc/resource_groups.json
resource-groups.user-scaling-limits-enabled=true

resource_groups.json:
{
  "rootGroups": [
    {
      "name": "BU1",
      "maxNodeLimit": "50%",
      "subGroups": [
        {
          "name": "Team1",
          "maxNodeLimit": "60%",
          "subGroups": [
            {
              "name": "${USER}",
              "maxNodeLimit": "40%"
            }
          ]
        },
        {
          "name": "Team2",
          "maxNodeLimit": "50%",
          "subGroups": [
            {
              "name": "${USER}",
              "maxNodeLimit": "80%"
            }
          ]
        }
      ]
    },
    {
      "name": "BU2",
      "maxNodeLimit": "80%",
      "subGroups": [
        {
          "name": "Team1",
          "maxNodeLimit": "20%"
        },
        {
          "name": "Team2",
          "maxNodeLimit": "80%",
          "subGroups": [
            {
              "name": "${USER}",
              "maxNodeLimit": "20%"
            }
          ]
        },
        {
          "name": "Team3",
          "maxNodeLimit": "30%"
        }
      ]
    },
    {
      "name": "BU3",
      "maxNodeLimit": "16%"
    }
  ],
  "selectors": [
    {
      "user": "User[1-3]",
      "group": "BU1.Team1.${USER}"
    },
    {
      "user": "User[4-5]",
      "group": "BU1.Team2.${USER}"
    },
        {
      "user": "*@team1.com",
      "group": "BU2.Team1"
    },
    {
      "user": "User[6-9]",
      "group": "BU2.Team2.${USER}"
    },
    {
      "user": "*@team3.com",
      "group": "BU2.Team3"
    },
    {
      "user": "User9",
      "group": "BU3"
    }
  ],
  "cpuQuotaPeriod": "1h"
}