Skip To Content
ArcGIS Developer
Dashboard

Edit (Scaling)

Description

The edit operation updates the scaling (replicas, min, and max) and resource allocation (cpuMin, cpuMax, memoryMin, and memoryMax) for an individual service. Changes made using this operation will be reflected in the deployment resource for the GIS service microservice.

Scaling in ArcGIS Enterprise on Kubernetes

Either manul scaling or autoscaling can be set for a GIS service microservice using the serviceScalingSpec parameter. Introduced at ArcGIS Enterprise on Kubernetes 10.9.1, autoscaling allows administrators to configure and deploy systems that respond to unexpected performance demands with minimal intervention and overhead. The ArcGIS Enterprise on Kubernetes autoscaling feature uses horizontal pod autoscaling, which, in response to an increase in resource usage, deploys more pods according to the values set by the administrator.

When a specific CPU utilization threshold (averageUtilization) is crossed, ArcGIS Enterprise on Kubernetes scales the number of pods up to the maximum (max) values set in the replicas JSON object. When utilization drops, and the additional resources are no longer needed, the system scales itself back down to no lower than the minimum (min) value set in the replicas JSON object. For more information on how to enable autoscaling, see the Editable properties section below.

Though scaling properties can be updated using the edit default properties and edit deployment operation, to reduce risk of errors it is recommended that changes to scaling information is performed using this operation.

Note:

When updating the scaling information for a shared instance service, such as a shared instance map service or hosted feature service, the scaling changes are applied to the deployments used to run those services and other shared instance services of a similar type.

Request parameters

ParameterDetails
serviceScalingSpec

(Required)

The service scaling properties, represented as a JSON object.

Example


serviceScalingSpec={
  "scalingSpec": [
    {
      "deploymentType": "MapServer",
      "replicas": {
        "min": 3,
        "max": 3,
        "scalingMode": "manual"
      },
      "deploymentId": "kui6zmtqzkjrsihh6tegq",
      "resources": {
        "memoryMin": "500Mi",
        "memoryMax": "2Gi",
        "cpuMin": "0.125",
        "cpuMax": "2"
      }
    }
  ]
}
async

(Optional)

Introduced at 10.9.1. This parameter specifies whether the operation will run synchronously or asynchronously. If false, the operation is run synchronously. If true, the operation is run asynchronously and the response returns a JSON object containing job information that can be used to track the job's status. The default value is false.

Values: true | false

f

The response format. The default format is html.

Values: html | json | pjson

Scaling properties

The following example demonstrates the scalingSpec JSON object of a GIS service microservice:


{
  "scalingSpec": [
    {
      "deploymentType": "MapServer",
      "replicas": {
        "min": 3,
        "max": 3,
        "scalingMode": "manual"
      },
      "deploymentId": "knftr3em9ezf1rb7tvpym",
      "resources": {
        "memoryMin": "500Mi",
        "memoryMax": "2Gi",
        "cpuMin": "0.125",
        "cpuMax": "2"
      }
    }
  ]
}

The following sections outline the individual properties included in the scalingSpec JSON object that can, and cannot, be updated using this operation.

Editable properties

The following properties can be updated using the edit operation:

PropertyDetails
replicas

The number of replicas for the service. The default value for manual scaling for min and max is 1. For manual scaling, both the min and max values must be the same.

Example of manual scaling


"replicas": {
  "min": 3,
  "max": 3,
  "scalingMode": "manual"
},

For organizations using ArcGIS Enterprise 11.2 on Kubernetes or later versions, version 2 (v2) of the autoscaling feature can be enabled by passing in the JSON object below and modifying the min, max, scalingMode, and averageUtilization values.

Note:

Prior to 11.2, the beta version of v2 autoscaling (v2beta2) could be enabled and be used to configure advanced scaling settings.

Autoscaling can be enabled by adjusting the scalingMode value to auto. The averageUtilization value will act as the CPU utilization threshold for autoscaling. If the threshold is crossed, ArcGIS Enterprise on Kubernetes scales up to the number of pods specified by the max value, and will return to no lower than the default pod level (the value set for min) once utilization decreases.

Advanced scaling settings for version 2 of autoscaling, such as scaling behaviors, can also be set with this operation.

Example of version 2 autoscaling


"replicas": {
  "min": 1,
  "max": 10,
  "scalingMode": "auto",
  "autoscaling": {
    "hpaSpec": {
      "metrics": [
        {
          "resource": {
            "name": "cpu",
            "target": {
              "averageUtilization": "65",
              "type": "Utilization"
            }
          },
          "type": "Resource"
        }
      ],
      "behavior": {
        "scaleDown": {
          "stabilizationWindowSeconds": 600, //Waits 10 minutes to observe recommendations and goes with an appropriate value for replicas to either scale up or down.
          "policies": [ //Two policies for scale down behaviors. Allows for staggering or setting limits on the rate of scaling down.
            {
              "periodSeconds": 180,
              "type": "Pods",
              "value": 5
            },
            {
              "periodSeconds": 80,
              "type": "Percent",
              "value": 25
            }
          ]
        },
        "scaleUp": {
          "policies": [ //Two policies for scale up behaviors. Allows for staggering or setting limits on the rate of scaling up.
            {
              "periodSeconds": 180,
              "type": "Pods",
              "value": 5
            },
            {
              "periodSeconds": 80,
              "type": "Percent",
              "value": 25
            }
          ]
        }
      },
      "hpaVersion": "autoscaling/v2"
    }
  }
},

Organizations using ArcGIS Enterprise on Kubernetes 10.9.1 can enable version 1 of the autoscaling feature by passing in the JSON object below and modifying the min, max, scalingMode, and targetCPUUtilizationPercentage values:

Example of version 1 autoscaling


"replicas": {
  "min": 1,
  "max": 5,
  "scalingMode": "auto",
  "autoscaling": {
    "hpaSpec": {
      "targetCPUUtilizationPercentage": 50
    },
    "hpaVersion": "autoscaling/v1"
  }
}
resources

The minimum and maximum resource allocations for the microservice, including the minimum memory (memoryMin) and minimum CPU (cpuMin) resources required for the service to start.

Example


"resources": {
  "memoryMin": "500Mi",
  "memoryMax": "2Gi",
  "cpuMin": "0.125",
  "cpuMax": "2"
},

Uneditable properties

The following properties cannot be edited but are required to be passed through in the serviceScalingSpec object:

PropertyDetails
deploymentType

The GIS service microservice type.

Values: FeatureServer | GeometryServer | GPServer | GPSyncServer | MapServer | TileServer

deploymentId

The microservice ID.

Example usage

The following is a sample POST request for the edit operation that demonstrates autoscaling, formatted for readability:


POST /context/admin/services/MyService.MapServer/scaling/edit HTTP/1.1
Host: organization.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []

serviceScalingSpec={
  "scalingSpec": [
    {
      "deploymentType": "MapServer",
      "replicas": {
        "min": 1,
        "max": 4,
        "scalingMode": "auto",
        "autoscaling": {
          "hpaSpec": {
            "metrics": [
              {
                "resource": {
                  "name": "cpu",
                  "target": {
                    "averageUtilization": "50",
                    "type": "Utilization"
                  }
                },
                "type": "Resource"
              }
            ],
            "hpaVersion": "autoscaling/v2"
          }
        }
      },
      "deploymentId": "kui6zmtqzkjrsihh6tegq",
      "resources": {
        "memoryMin": "500Mi",
        "memoryMax": "2Gi",
        "cpuMin": "0.125",
        "cpuMax": "2"
      }
    }
  ]
}&async=false&f=pjson&token=_2AKqbDf5yQyOBrCXyfoMx3vHLY3z7Hp-ZQ27GJXN9Vqz5og2NnjAZjbHiB6YUnLg3gslmfCkDWgqEtsPmLIXB3gnhkmYD3VzM698NLJnoN4gOlXdn3EXX3UUJGXO4s19-fh8_stvig0ldDffzz6AuAbOWLPlTf0hOmyhxNJi8WckhJMV_VZ1SHNAGrcwdF6hPKoUQHTqcoAqNdsBUglm1VqH2nG8oq1a9JjESkTtDR12Yc-4dlttQPyiDsRVwZu

JSON Response example

If async is false, the following response is returned once a service's scaling is edited successfully:

{"status": "success"}

If async is true, the following response is returned. The value returned for jobsUrl can be used to access the job resource to track a job's status after it has been submitted. For more information, see the Job resource topic.


{
  "jobsUrl": "https://organization.domain.com/context/admin/jobs/ja2ca1a35-881c-400c-a49a-b26883002d6c",
  "jobID": "ja2ca1a35-881c-400c-a49a-b26883002d6c",
  "jobStatus": "SUBMITTED"
}