

# What is Amazon GameLift Servers FleetIQ?
What is Amazon GameLift Servers FleetIQ?

Amazon GameLift Servers FleetIQ optimizes the use of low-cost Amazon Elastic Compute Cloud (Amazon EC2) Spot Instances for cloud-based game hosting. With Amazon GameLift Servers FleetIQ, you can work directly with your hosting resources in Amazon EC2 and Amazon EC2 Auto Scaling while taking advantage of Amazon GameLift Servers optimizations to deliver inexpensive, resilient game hosting for your players. Amazon EC2 Spot Instances, although offered at steep discounts, are not generally viable for game hosting because availability fluctuates and there is the potential for [interruptions](https://docs.amazonaws.cn/AWSEC2/latest/UserGuide/spot-interruptions.html). Amazon GameLift Servers FleetIQ significantly mitigates these limitations, making the use of low-cost Spot Instances viable for game hosting.

FleetIQ optimizations are also available when using Amazon GameLift Servers to manage your game hosting. For information on Amazon GameLift Servers hosting options, see the [Amazon GameLift Servers Developer Guide](https://docs.amazonaws.cn/gamelift/latest/developerguide/gamelift-intro.html).

The Amazon GameLift Servers FleetIQ game hosting solution is designed for game developers who: 
+ Have existing Amazon deployments or want to use Amazon EC2 directly rather than through the fully managed Amazon GameLift Servers service. Amazon GameLift Servers FleetIQ works with EC2 Auto Scaling groups that you manage in your Amazon Web Services account, giving you full access to your EC2 instances and groups. You can also integrate with other Amazon services, including Amazon Elastic Container Service (Amazon ECS), Amazon Elastic Kubernetes Service (Amazon EKS), and Amazon Shield Advanced.
+ Have existing on-premises game hosting and want to extend capacity to the cloud. With Amazon GameLift Servers FleetIQ, you can build a hybrid deployment system that uses your on-premises capacity and incrementally adds Amazon cloud capacity as needed.

**Ready to start working with Amazon GameLift Servers FleetIQ?**  
Learn how to use Amazon GameLift Servers FleetIQ for your game by taking the course [Using Amazon Amazon GameLift Servers FleetIQ for Game Servers](https://explore.skillbuilder.aws/learn/course/external/view/elearning/435/using-amazon-gamelift-fleetiq-for-game-servers) on Amazon Skill Builder. For an overview of related courses, see the [Game Tech Learning Plan](https://explore.skillbuilder.aws/learn/public/learning_plan/view/26/game-tech-learning-plan). Some courses are available in different languages.
Follow the instructions in [Amazon GameLift Servers FleetIQ integration steps](gsg-getting-started.md).

# How Amazon GameLift Servers FleetIQ works
How FleetIQ works

The Amazon GameLift Servers FleetIQ solution is a game hosting layer that supplements the full set of computing resource management tools that you get with Amazon EC2 and Auto Scaling. In addition to offering a slate of features specific to game hosting, Amazon GameLift Servers FleetIQ provides an extra layer of logic that makes it possible to use low-cost Spot Instances for game hosting. This solution lets you directly manage your Amazon EC2 and Auto Scaling resources and integrate as needed with other Amazon services.

When using Amazon GameLift Servers FleetIQ, you prepare to launch Amazon EC2 instances as usual: make an Amazon Machine Image (AMI) with your game server software, create an Amazon EC2 launch template, and define configuration settings for an Auto Scaling group. However, instead of creating an Auto Scaling group directly, you create a Amazon GameLift Servers FleetIQ game server group with your Amazon EC2 and Auto Scaling resources and configuration. This action prompts Amazon GameLift Servers FleetIQ to create both a game server group and a corresponding Auto Scaling group. The game server group is linked to and manages certain aspects of the Auto Scaling group.

After the Auto Scaling group is created, you have full access to your Amazon EC2 and Auto Scaling resources. You can change the configuration of your Auto Scaling groups, add multi-level scaling policies or load balancers, and integrate with other Amazon services. You can connect directly to instances in the group. As part of its optimization logic, Amazon GameLift Servers FleetIQ also makes periodic updates to certain Auto Scaling group properties. You can track the availability status of all instances deployed by the Auto Scaling group.

You can temporarily suspend Amazon GameLift Servers FleetIQ activity for a game server group at any time. You also have the option to delete a game server group but retain the corresponding Auto Scaling group.

**Topics**
+ [

# Amazon GameLift Servers FleetIQ logic
](gsg-howitworks-logic.md)
+ [

# Key resources and components
](gsg-howitworks-resources.md)

# Amazon GameLift Servers FleetIQ logic


The following diagram illustrates the role of Amazon GameLift Servers FleetIQ when it is working with Amazon EC2 for game hosting. Its primary goal is to locate the *best* possible game server to host a game session and give players an optimal gameplay experience. Amazon GameLift Servers FleetIQ defines the *best* resources as those that deliver the highest game hosting viability for the lowest cost. Amazon GameLift Servers FleetIQ approaches this goal in two key ways: first by allowing only viable instance types in the Auto Scaling group, and second by placing new game sessions effectively across the group's available resources.

![\[Amazon GameLift Servers FleetIQ works alongside Amazon EC2\]](http://docs.amazonaws.cn/en_us/gameliftservers/latest/fleetiqguide/images/gsg-howitworks-logic.png)


## Fill Auto Scaling group with optimal instance types


The job of the Auto Scaling group is to launch new instances and retire old instances, maintaining a collection of hosting resources and scaling it to meet your player demand. To do this, the Auto Scaling group relies on a list of your desired instance types. The job of Amazon GameLift Servers FleetIQ is to continually check the viability of these desired instance types and update the list for the Auto Scaling group. This process is called instance balancing. It ensures that instances in the Auto Scaling group are continually refreshed so that only currently viable instance types are used at all times.

Amazon GameLift Servers FleetIQ affects how the Auto Scaling group selects optimal instance types in the following ways: 
+ **It determines usage of Spot and/or On-Demand Instances.** An Amazon GameLift Servers FleetIQ game server group is configured with a balancing strategy, which influences how the Auto Scaling group uses Spot and/or On-Demand Instances. Spot Instances have lower costs due to fluctuating availability and potential [interruptions](https://docs.amazonaws.cn/AWSEC2/latest/UserGuide/spot-interruptions.html), limitations that Amazon GameLift Servers FleetIQ minimizes for game server hosting. On-Demand instances are more expensive but offer more reliable availability when you need it. 
+ **It limits new instances to launch on viable instance types only.** A Amazon GameLift Servers FleetIQ game server group maintains a master list of your desired instance types, The instance balancing process continually evaluates each desired instance type on the list for game hosting viability, using a prediction algorithm that looks at the instance type's recent availability and interruption rate. As a result of this evaluation, Amazon GameLift Servers FleetIQ continually updates the Auto Scaling group's list of desired instance types to include only currently viable instances types. 
+ **It flags existing instances that are non-viable instance types.** Amazon GameLift Servers FleetIQ identifies existing instances in an Auto Scaling group that are currently non-viable instance types. These instances are flagged as *draining*, which means they are terminated and replaced with new instances. For instances that have game server protection turned on, termination is postponed until any active game sessions end normally. 

As the Auto Scaling group launches and retires instances, it maintains a collection that is optimized for game hosting even as the availability of low-cost Spot Instance types fluctuates. Balancing activity takes place on game server groups with active instances only. Learn more about how this process works in [Spot balancing process](gsg-lifecycle-rebalance.md).

## Place game sessions effectively


Amazon GameLift Servers FleetIQ tracks all active game servers in the game server group and uses this information to determine the best placement for new game sessions and players.

To enable Amazon GameLift Servers FleetIQ to track game servers, your game server software must report its status. Your custom AMI controls how new game servers processes are started and stopped on each instance. When a new game server is started, it registers with Amazon GameLift Servers FleetIQ, indicating that it is ready to host a game session. After registering, the game server periodically reports its health and whether it is currently hosting a game session. When the game server shuts down, it de-registers with Amazon GameLift Servers FleetIQ.

To start a new game session, your game client (or matchmaker or other client service) sends a request for a game server to Amazon GameLift Servers FleetIQ. Amazon GameLift Servers FleetIQ locates an available game server, claims it for the new game session, and responds with the game server ID and connection info. Your game then prompts the game server to update its status and start a new game session for incoming players.

When selecting a game server to host a new game session, Amazon GameLift Servers FleetIQ uses the following decision-making process to optimize placement with viable low-cost Spot Instances:

1. Where possible, Amazon GameLift Servers FleetIQ places new game sessions on instances that are already hosting other game sessions. By packing (but not overloading) some instances and keeping others idle, the Auto Scaling group is able to quickly scale down idle instances when they're not needed, which lowers hosting costs. 

1. Amazon GameLift Servers FleetIQ ignores instances that are flagged as *draining*, that is, not viable for game hosting. These instances are kept running only to support existing game sessions. They can't be used for new game sessions unless no other game servers are available. 

1. Amazon GameLift Servers FleetIQ identifies all available game servers that are running on viable instances.

You can turn on game session protection for a game server group to prevent the Auto Scaling group from terminating instances with actively running game sessions.

# Key resources and components


Create the following resources in your Amazon account before you set up your game hosting resources with Amazon GameLift Servers FleetIQ. As a best practice, develop and test your game server deployment with these resources before using them through a game server group. 
+ **Amazon Machine Image (AMI).** An AMI is a template for a specific software configuration that you want to launch with your Amazon EC2 instances. For game hosting, your AMI includes an operating system, your game server binaries or container, and other runtime software that your game server requires. For more information about creating an AMI, refer to [ Amazon Machine Images](https://docs.amazonaws.cn/AWSEC2/latest/UserGuide/AMIs.html) in the Amazon EC2 User Guide. AMIs are Region-specific. You can copy an AMI from one Region to another, as described in [Copying AMIs](https://docs.amazonaws.cn/AWSEC2/latest/UserGuide/CopyingAMIs.html) in the *Amazon EC2 User Guide*.
+ **Amazon EC2 launch template.** A launch template provides instructions for launching and managing instances in an Auto Scaling group. It specifies an AMI, provides a list of suitable instance types, and sets network, security, and other properties. For more information about creating a launch template, see [Launching an Instance from a Launch Template ](https://docs.amazonaws.cn/AWSEC2/latest/UserGuide/ec2-launch-templates.html) in the *Amazon EC2 User Guide*. Launch templates are Region-specific.
+ **Amazon IAM role.** An IAM role defines a set of permissions that allow limited access to Amazon resources. A trusted entity, such as another Amazon service, can assume the role and inherit its permissions. When using Amazon GameLift Servers FleetIQ, you must provide an IAM role with a managed policy that allows Amazon GameLift Servers FleetIQ to create and access Auto Scaling groups and EC2 instance resources in your Amazon account. IAM roles are not Region-specific.

Amazon GameLift Servers FleetIQ manages the following resources directly and has direct authority over them.
+ **Amazon GameLift Servers game server group**. A game server group contains configuration settings that define how Amazon GameLift Servers FleetIQ works with a corresponding Auto Scaling group to deliver low-cost game hosting. Game server groups are Region-specific. When you create a game server group in a Region, a new Auto Scaling group is automatically created in your Amazon account in the same Region. The game server group is linked to the Auto Scaling group and has access (by assuming the IAM role) to manage and modify some of its settings. A game server group is a long-lived resource; developers should expect to create them infrequently. A game server group is also a functional grouping resource for game servers that are hosted on instances in the Auto Scaling group and registered with Amazon GameLift Servers FleetIQ. 
+ **Amazon GameLift Servers game server.** A game server resource represents a game execution that is running on an instance associated with a Amazon GameLift Servers FleetIQ game server group. This resource is created when a game server registers with Amazon GameLift Servers FleetIQ and identifies the game server group it belongs to. Amazon GameLift Servers FleetIQ tracks the utilization status and claim status of each registered game server, which enables it to monitor game server availability. Game servers are Region-specific in that they are associated with a Region-specific game server group. When your game requests a new game server, it specifies the game server group and Region.

These resources are created through Amazon GameLift Servers FleetIQ resources. They are created in your Amazon account and you have full control of them.
+ **Amazon EC2 Auto Scaling group.** An Auto Scaling group launches and manages a collection of EC2 instances, and automatically scales group capacity. With Amazon GameLift Servers FleetIQ, there is a one-to-one relationship between the game server group and the Auto Scaling group. While you can update all settings for an Auto Scaling group, Amazon GameLift Servers FleetIQ periodically overrides and updates certain settings as part of its logic to balance Spot Instances for game hosting viability. For more information, see [ AutoScalingGroup](https://docs.amazonaws.cn/autoscaling/ec2/userguide/AutoScalingGroup.html) in the *Amazon EC2 Auto Scaling User Guide*. Auto Scaling groups are Region-specific; they are created in the same Region as the game server group.
+ **Amazon EC2 Instance.** An instance is a virtual server in the cloud. Instance types have specific hardware configurations that specify compute, memory, disk, and network resources. They are typically launched by an Auto Scaling group with an AMI. Instances can be Spot or On-Demand, depending on availability. With Amazon GameLift Servers FleetIQ, instances run one or multiple game server processes, each of which can host multiple game sessions. Instances are Region-specific in that they are associated with a Region-specific Auto Scaling group.

# Game architecture with Amazon GameLift Servers FleetIQ
Game architecture

## Supplementing on-premises hosting


Amazon GameLift Servers FleetIQ is designed to reuse your existing game backend, including any player geo-IP routing, matchmaking, or lobby services that you might already have in place. The following example illustrates how Amazon GameLift Servers FleetIQ might fit into an existing on-premises deployment.

**Example**  
In this example, game hosting is initially handled with four proprietary data centers to host players in North America and Europe. Depending on their approximate physical location, players are routed to one of two regional matchmakers. The matchmakers group players by skill and latency and then place them onto nearby game servers to minimize lag.   

![\[On-premises game architecture\]](http://docs.amazonaws.cn/en_us/gameliftservers/latest/fleetiqguide/images/gsg-architecture-onprem.png)

The game developer wants to replace their North America game servers with servers provided by Amazon GameLift Servers FleetIQ. To start, they make minor updates to their game server to enable it for use with Amazon GameLift Servers FleetIQ and then create an Amazon Machine Image (AMI). This image will be installed on every EC2 instance that is deployed for the game. The image contains the game server, dependencies, and anything else needed to run game sessions for players.  
With the AMI ready, the developer creates two Amazon GameLift Servers FleetIQ game server groups, one for each Amazon North America Region (`us-east-1` and `us-west-2)`. The developer passes in launch template (which provides the AMI), a list of desired instance types, and other configuration settings for the group. The list of desired instance types tells Amazon GameLift Servers FleetIQ which types to use when checking for Spot Instances that are viable for game hosting.  
Finally, the developer integrates the Amazon SDK with Amazon GameLift Servers FleetIQ into their North American matchmaker, which calls Amazon GameLift Servers FleetIQ when a new group of players needs server capacity for a game session. Amazon GameLift Servers FleetIQ locates a Spot Instance with an available game server, reserves it for the players, and provides server connection information. Players connect to the server, play the game, and disconnect. To start a new game, players re-enter matchmaking, which prompts Amazon GameLift Servers FleetIQ to find another available game server. Each new game request triggers Amazon GameLift Servers FleetIQ to search for and select game servers with a low chance of interruptions. As a result, Amazon GameLift Servers FleetIQ is constantly redirecting players away from game servers that are not viable for game hosting, even as Spot Instance availability fluctuates over time.  

![\[On-premises + Amazon GameLift Servers FleetIQ game architecture\]](http://docs.amazonaws.cn/en_us/gameliftservers/latest/fleetiqguide/images/gsg-architecture-onprem-gamelift.png)


# Life of a game server group


Game server groups go through the following life cycle, including provisioning and status updates. A game server group is expected to be a long-lived resource.

![\[Lifecycle of a game server group resource.\]](http://docs.amazonaws.cn/en_us/gameliftservers/latest/fleetiqguide/images/gsg-lifecycles-gameservergroup.png)

+ You create a game server group by calling the Amazon GameLift Servers API `CreateGameServerGroup()` and passing in an EC2 launch template and configuration settings. In response to the call, a new game server group is created and placed in status NEW.
+ Amazon GameLift Servers FleetIQ activates an asynchronous activation workflow, transitioning the game server group status to ACTIVATING. The workflow initiates the creation of underlying resources, including an Amazon EC2 Auto Scaling group and an EC2 instance with the provided AMI.
  + If provisioning fails for any reason, the game server group is placed into status ERROR. To get additional error information to help debug the failure cause, call `DescribeGameServerGroup()` on a game server group in an error state.
  + If provisioning succeeds, the game server group is transitioned to status ACTIVE. At this point, instances are launched with game servers that register with Amazon GameLift Servers FleetIQ. The group's instance types are periodically evaluated for game hosting viability and balanced as needed. Amazon GameLift Servers FleetIQ also tracks the status of active game servers in the group and responds to requests for game servers.
+ You remove a game server group by calling `DeleteGameServerGroup()` with the group identifier. This action puts the game server group into status DELETE\$1SCHEDULED. Only game server groups in ACTIVE or ERROR state can be scheduled for deletion. 
+ Amazon GameLift Servers FleetIQ activates an asynchronous deactivation workflow in response to the DELETE\$1SCHEDULED status, transitioning the game server group status to DELETING. You have the option of deleting just the game server group or delete both the game server group and the linked Auto Scaling group.
  + If deactivation fails for any reason, the game server group is placed into status ERROR. To get additional error information to help debug the failure cause, call `DescribeGameServerGroup()` on a game server group in an error state.
  + If deactivation succeeds, the game server group is transitioned to status DELETED.

# Life of a game server


With Amazon GameLift Servers FleetIQ, game servers go through the following life cycle, including provisioning and status updates. A game server is expected to be a short-lived resource. As a best practice, game servers should be de-registered after the end of a game session rather than being re-used for another game session. This approach helps ensure that available game servers are always running on the lowest-cost resources that are viable for game hosting.
+ A game server resource is created when the game server process, running on an instance in a Amazon GameLift Servers FleetIQ-linked Auto Scaling group, calls the Amazon GameLift Servers API `RegisterGameServer()` to notify Amazon GameLift Servers FleetIQ that it is ready to host players and gameplay. A game server has two statuses to track its current availability:
  + Utilization status tracks whether the game server is currently supporting gameplay. This status is initially set to AVAILABLE, indicating that it is ready to accept new gameplay. Once the game server is occupied with gameplay, this status is set to UTILIZED.
  + Claim status tracks whether the game server is claimed for imminent gameplay. A game server in CLAIMED status indicates that it has been temporarily reserved by a game client (or a game service such as a matchmaker). This status prevents Amazon GameLift Servers FleetIQ from providing the same game server to multiple requesters. A game server with a blank claim status is available to be claimed. 
+ The following diagram illustrates how a game server's utilization status and claim status change over its life span.  
![\[Lifecycle of a game server resource.\]](http://docs.amazonaws.cn/en_us/gameliftservers/latest/fleetiqguide/images/gsg-lifecycles-gameserver.png)
  + **Step 1.** A game server group has six registered game servers. Four have a utilization status AVAILABLE (A, B, C, and D), and two are currently UTILIZED (E and F).
  + **Step 2.** A game client or matchmaking system calls the Amazon GameLift Servers API `ClaimGameServer()` to request a new game server. This request prompts Amazon GameLift Servers FleetIQ to search for an available game server (D) and set its claim status to CLAIMED for 60 seconds. Amazon GameLift Servers FleetIQ responds to its request with connection information for the game server (IP address and port), as well as other optional game-specific data. Since gameplay has not yet begun on the game server, its utilization status remains AVAILABLE, but it cannot be claimed with another request.
  + **Step 3a.** Using the connection information provided, game clients can connect to the game server and initiate gameplay. The game server (D) must be triggered within 60 seconds to change its utilization status to UTILIZED by calling the Amazon GameLift Servers API `UpdateGameServer()`. 
  + **Step 3b.** If the game server's utilization status is not updated within 60 seconds, the claim timer expires and the claim status is reset to blank. The game server (D) is returned to the pool of available and unclaimed game servers.
+ A game server resource is removed after gameplay on the game server is complete and players have disconnected. Before shutting down, the game server process calls the Amazon GameLift Servers API `DeregisterGameServer()` to notify Amazon GameLift Servers FleetIQ of its departure from the game server group's pool of game servers.

# Spot balancing process


Amazon GameLift Servers FleetIQ periodically balances the instances in an Auto Scaling group that has Spot Instances. This process is not active with game server groups that use the ON\$1DEMAND\$1ONLY balancing strategy or do not have any active instances. 

Spot balancing has two key goals: 
+ To constantly refresh the group by only using Spot Instance types that are viable for game hosting.
+ To use multiple viable instance types (where possible) in order to reduce the impact of unexpected game server interruptions.

 Amazon GameLift Servers FleetIQ balances by evaluating the group's instance types and removing instances that are more likely to result in game server interruptions. To avoid terminating instances with active gameplay during balancing, best practice is to turn on game server protection for a game server group that's in production.

**Example**  
The following example illustrates how instances in an Auto Scaling group are affected by Spot balancing.  

![\[Lifecycle of an Auto Scaling group during Amazon GameLift Servers FleetIQ balancing.\]](http://docs.amazonaws.cn/en_us/gameliftservers/latest/fleetiqguide/images/gsg-lifecycles-rebalancing.png)

+ **Step 1.** Through a game server group, the linked Auto Scaling group is set up to launch instances of types m4.large, c4.large, and c5.large with game server protection enabled. The Auto Scaling group has launched a balanced collection consisting of two Spot Instances of each type. Four instances have at least one game server in UTILIZED status (shown with a dashed border), while two instances are not currently supporting gameplay. 
+ **Step 2.** Amazon GameLift Servers FleetIQ evaluates the current game hosting viability of all three instance types. The evaluation determines that the c4.large instance type has an unacceptable potential for game server interruption. Amazon GameLift Servers FleetIQ immediately updates the Auto Scaling group configuration to temporarily remove c4.large from the list of instance types, preventing additional c4.large instances from being launched. 
+ **Step 3.** Amazon GameLift Servers FleetIQ identifies existing instances of type c4.large and takes actions to remove them from the group. As a first step, all game servers that are running on c4.large instances are flagged as *draining*. Game servers on draining instances can be claimed only as a last resort if no other game servers are available. In addition, an Auto Scaling group with draining instances is triggered to launch new instances to replace them.
+ **Step 4.** As new viable instances come online, the Auto Scaling group terminates draining instances. This replacement ensures that the group's desired capacity is maintained. The first instance to be terminated is the c4.large instance with no utilized game servers and game server protection turned off. It is replaced with a new c5.large instance. 
+ **Step 5.** Draining instances with game server protection continue to run while their game servers are supporting gameplay. When gameplay ends, the remaining c4.large instance is terminated when a new m4.large instance has launched to take its place. 
As a result of this process, the Auto Scaling group maintains its desired capacity while the group balances from using three instance types to two. Amazon GameLift Servers FleetIQ continues to evaluate the original list of instance types for game hosting viability. When c4.large is again considered a viable instance type, the Auto Scaling group is updated to include all three instance types. The group naturally balances over time.

# Amazon GameLift Servers FleetIQ best practices
Best practices

Amazon GameLift Servers FleetIQ is a low-level logic layer that helps you manage Amazon EC2 resources for game hosting. In particular, Amazon GameLift Servers FleetIQ optimizes the use of Spot Instances that are viable for game hosting by minimizing the chance that game sessions might be interrupted. It also provides basic game hosting functionality to track available game servers and route gameplay to low-cost, high-viability game servers. 

Amazon GameLift Servers FleetIQ as a standalone feature does not provide advanced features that are offered with the fullly managed Amazon GameLift Servers solution, which also uses FleetIQ to minimize hosting costs. If you need features such as matchmaking, latency-based player routing, game session and player session management, and versioning, take a look at the Amazon GameLift Servers solutions.

Here are some best practices that can help you get the most benefit from Amazon GameLift Servers FleetIQ.
+ **Use Amazon GameLift Servers FleetIQ for session-based games.** Amazon GameLift Servers FleetIQ works best when it is constantly directing players onto instances that are least likely to have game session interruptions. Maintaining long-lived sessions interferes with the Amazon GameLift Servers FleetIQ balancing process, which increases the likelihood that games sessions might be interrupted. The ideal workflow is for players to go from matchmaking (or server selection) into gameplay. When the game ends, players go back to matchmaking and are routed to another game server on a new instance. We recommend using Amazon GameLift Servers FleetIQ for games with sessions under two hours.
+ **Provide many instance types to choose from.** When you set up a game server group, you provide a list of instance types to be used. The more instance types that you include, the greater flexibility Amazon GameLift Servers FleetIQ has to use Spot Instances with high viability for game hosting. For example, you might list multiple sizes within the same instance family (c5.large, c5.xlarge, c5.2xlarge, c5.4xlarge). With larger instances, you can run more game servers on each instance, potentially lowering costs. With smaller instances, autoscaling can react faster to changes in player demand. Keep in mind that the list of desired instance types is not prioritized—an Auto Scaling group will use a balance of viable instance types to maintain the group's resiliency.
+ **Test your game on all instance types.** Ensure that your game server runs properly on every instance type that you configure for your game server group.
+ **Use instance capacity weighting.** If you configure your game server group to use a range of instance sizes (such as c5.2xlarge, c5.4xlarge, c5.12xlarge), include capacity weighting information for each instance type. For more information, see [Instance Weighting for Amazon EC2 Auto Scaling](https://docs.amazonaws.cn/autoscaling/ec2/userguide/asg-instance-weighting.html) in the *Amazon EC2 Auto Scaling User Guide*.
+ **Place your game sessions using Amazon GameLift Servers FleetIQ.** When placing groups of players with game servers, use the Amazon GameLift Servers API `ClaimGameServer()`. Amazon GameLift Servers FleetIQ avoids placing players on instances with a higher chance of game session interruptions. 
+ **Report game server status to Amazon GameLift Servers FleetIQ.** Periodically report server health and utilization status with the Amazon GameLift Servers API `UpdateGameServer()`. Maintaining accurate game server status helps Amazon GameLift Servers FleetIQ place gameplay more efficiently. It also helps avoid terminating instances with active gameplay during Spot balancing activity.
+ **Set up an auto scaling policy.** You can create a target-tracking scaling policy that maintains your hosting capacity based on player utilization and anticipated demand. The Amazon GameLift Servers FleetIQ metric `PercentUtilizedGameServers` is a measure of how much of your hosting capacity is currently in use. Most games want to maintain a buffer of unused game servers so that new players can get into a game quickly. You can create a scaling policy that maintains a certain buffer size, adding or removing instances as player demand fluctuates. For more information, see [ Target Tracking Scaling Policies](https://docs.amazonaws.cn/autoscaling/ec2/userguide/as-scaling-target-tracking.html) in the Amazon EC2 Auto Scaling User Guide. 
+ **Use different Amazon accounts for development and production environments.** Separating your development and production configurations across accounts can reduce the risk of misconfiguration impacting live players.
+ **Enable game session protection for game server groups in production.** To protect your players, turn on game session protection and prevent active game sessions from being terminated early due to scaling or balancing activity.
+ **Test your game on EC2 before integrating it with Amazon GameLift Servers FleetIQ.** We recommend getting your game up and running on EC2 and fine-tune your configuration first. You can then create a game server group using the same launch template and AMI. 

  If you're using Kubernetes, we recommend first getting standard EC2 instances added to your Kubernetes cluster, then create a game server group using the launch template you create for worker nodes in your Kubernetes cluster. If you're using EKS, create your EKS cluster and game server group separately. For the game server group, use the EKS-optimized AMI with the appropriate user data and the launch template configuration used for your EKS integration. See more details about EKS worker nodes and the EKS optimized AMI in the [Amazon EKS-Optimized Linux AMI](https://docs.amazonaws.cn/eks/latest/userguide/eks-optimized-ami.html) guide.
+ **Use the game server group balancing strategy `ON_DEMAND_ONLY` for reliable game server availability.** With this balancing strategy in force, no Spot Instances are used. This is a useful tool to ensure server availability when you need it most, such as during feature launches or other special events. You can swtich a game server group from a Spot to an On-Demand strategy as needed.

Also review these Amazon best practices:
+ [Best Practices for Amazon EC2](https://docs.amazonaws.cn/AWSEC2/latest/UserGuide/ec2-best-practices.html)
+ [Best Practices for Amazon EC2 Auto Scaling](https://docs.amazonaws.cn/autoscaling/ec2/userguide/gs-best-practices.html)

## Amazon GameLift Servers FleetIQ features

+ **Optimized Spot balancing.** Amazon GameLift Servers FleetIQ periodically evaluates your instance types and replaces Spot Instances that are not considered viable due to a higher potential for game session interruptions. As your EC2 Auto Scaling group retires old instances and starts new ones, the group continually refreshes with instance types that are currently viable for game hosting.
+ **Optimum player routing.** Amazon GameLift Servers FleetIQ APIs direct new game sessions onto the most resilient Spot Instances, where they are least likely to be interrupted. In addition, game sessions are packed onto fewer instances, which improves the EC2 Auto Scaling group's ability to scale down unneeded resources and lower hosting costs.
+ **Automatic scaling based on player usage.** Amazon GameLift Servers FleetIQ emits game server utilization data as Amazon CloudWatch metrics. You can use these metrics to automatically scale your available hosting resources to track with actual player demand and reduce hosting costs.
+ **Direct management of Amazon EC2 instances.** Maintain full control of the EC2 instances and EC2 Auto Scaling groups in your Amazon Web Services account. This means that you can set up instance launch templates, maintain EC2 Auto Scaling group configurations, and integrate with other Amazon services. As part of its Spot balancing activity, Amazon GameLift Servers FleetIQ makes periodic updates to some EC2 Auto Scaling group properties. You can temporarily override these settings or suspend Amazon GameLift Servers FleetIQ activity as needed.
+ **Support for multiple game server executable formats.** Amazon GameLift Servers FleetIQ supports all formats that currently run on Amazon EC2, including Windows, Linux, containers, and Kubernetes. See the [Amazon EC2 FAQs](https://www.amazonaws.cn/ec2/faqs/) for a list of supported operating systems and runtimes.
+ **Multiple types of hosting resources. **With Amazon GameLift Servers FleetIQ, you have access to a large range of instance types for game server hosting. (Availability varies by Amazon Region.) This means that you can pair your game server with the appropriate mix of CPU, memory, storage, and networking capacity to provide the best possible gaming experience for your players.
+ **Worldwide reach.** Amazon GameLift Servers FleetIQ is available in 15 Regions, including in China. With this reach, you can make your game servers available with minimal lag to players, wherever they're located. For a complete list of Regions, see [Amazon GameLift Servers endpoints and quotas](https://docs.amazonaws.cn/general/latest/gr/gamelift.html) in the *Amazon Web Services General Reference*.

## Pricing for Amazon GameLift Servers FleetIQ


Amazon GameLift Servers charges for instances by duration of use and for bandwidth by quantity of data transferred. For a complete list of charges and prices for Amazon GameLift Servers, see [Amazon GameLift Servers Pricing](https://www.amazonaws.cn/gamelift/servers/pricing).

For information on calculating the cost of hosting your games or matchmaking with Amazon GameLift Servers, see [Generating Amazon GameLift Servers pricing estimates](https://docs.amazonaws.cn/gameliftservers/latest/developerguide/gamelift-calculator.html), which describes how to use the [Amazon Pricing Calculator](https://calculator.aws/#/createCalculator/GameLift).