The Wayback Machine - https://web.archive.org/web/20170717195929/http://docs.aws.amazon.com:80/gamelift/latest/developerguide/fleets-autoscaling.html
Menu
Amazon GameLift
Developer Guide (Version )

Set Up Fleet Autoscaling

Use autoscaling to have Amazon GameLift automatically scale your fleet capacity in response to activity on your game servers. This topic provides help with creating an autoscaling policy and offers tips on configuring your fleet to optimize the benefits of autoscaling. For more information on how autoscaling works, see the Autoscaling section in "How Amazon GameLift Works" overview.

To activate Amazon GameLift's autoscaling feature for a fleet, define one or more autoscaling policies. The Amazon GameLift console offers a simple tool for creating, updating, and viewing your autoscaling policies. You can also manage your policies using the AWS Command Line Interface (CLI).

Set Autoscaling with the Console

  1. Sign in to the AWS Management Console and open the Amazon GameLift console at https://console.aws.amazon.com/gamelift/.

  2. On the Fleets page, click the name of the fleet you want to set an autoscaling policy for. This opens the fleet's detail page.

  3. Click the Scaling tab. This tab lets you to adjust the fleet's scaling settings and displays current scaling settings and fleet capacity history.

  4. Under Scaling: Limits, set the minimum and maximum number of instances to allow in the fleet. These limits are primarily useful to restrain automatic scaling, but also prevent users from manually setting capacity outside the limits. Click Add Policy to start a new policy statement. Type a policy name that is unique to this fleet.

  5. Under Scaling policy, choose whether to use manual or automatic scaling. If you choose manual scaling, specify the target number of instances to maintain in the fleet.

  6. If you choose automatic scaling, add one or multiple scaling policies.

  7. Create a policy by setting the policy statement parameters. For help, see Create an Autoscaling Policy Statement. To save the policy, click the checkmark icon. Once saved, Amazon GameLift begins evaluating metric data against the policy within ten minutes.

    As an example, the following policy statement ensures that fleet capacity will always be increased if the number of idle instances (instances that are not currently hosting game sessions) drops below two for longer than 10 minutes: "If Idle Instances are < 2 for 10 minutes, then scale up by 1 instance".

Set Autoscaling with the AWS CLI

  1. In a command line window, type the put-scaling-policy command with the following parameters. For help setting parameters, see Create an Autoscaling Policy Statement.

    Copy
    --fleet-id <unique fleet identifier> --name "<unique policy name>" --metric-name <name of metric> --comparison-operator <comparison operator> --threshold <threshold integer value> --evaluation-periods <number of minutes> --scaling-adjustment-type <adjustment type> --scaling-adjustment <adjustment amount>

    Example:

    Copy
    aws gamelift put-scaling-policy --fleet-id fleet-eead767f-acb4-4c2a-9280-a3c523cbe50f --name "scale up when available player sessions is low" --metric-name AvailablePlayerSessions --comparison-operator LessThanThreshold --threshold 50 --evaluation-periods 10 --scaling-adjustment-type ChangeInCapacity --scaling-adjustment 1
  2. When using autoscaling, you should set minimum and maximum capacity limits. Type the update-fleet-capacity command with the following parameters:

    Copy
    --fleet-id <unique fleet identifier> --min-size <minimum capacity for autoscaling> --max-size <maximum capacity for autoscaling>

    Example:

    Copy
    aws gamelift update-fleet-capacity --fleet-id fleet-eead767f-acb4-4c2a-9280-a3c523cbe50f --min-size 1 --max-size 10