Fleet Policy
Last updated
Was this helpful?
Last updated
Was this helpful?
Policies are a set of restrictions that your fleet follows to create deployments in specific locations. Without them, your fleet will not work properly. You will need at least one policy, but you can add multiple policies to create deployments at multiple locations on a single fleet.
We will continue our fleet for the North American continent to better understand.
Let's say we want these parameters for our policy:
A minimum of 3 deployments
A maximum of 10 deployments
We want our deployment to scale when 80% of the capacity is reached
We only want deployment in North America
Once created, you will be redirected to the detail page of your new policy.
Name: The name of your policy. It must be unique within the fleet.
Enabled: Whether your policy is enabled or not. As opposed to the fleets, we recommend letting it enabled by default, so you don't have to go back to enable it. The policy won't do any deployments until the fleet is enabled.
Minimum: The minimum amount of deployment that must be running at any time for this policy. It is required to be at least one otherwise the fleet policy would not make any deployments.
The minimum
policy setting will ignore empty time to live
of your session's configuration, ensuring that you always have at least the minimum number of deployments specified.
Maximum: The maximum amount of deployments that the policy can scale up. If left empty or null in the API, it can scale as much as needed. Be aware that with scaling comes costs, but if your game starts scaling fast, it's probably a good sign for your game.
Threshold: Refers to the point at which a new deployment should be created based on the number of session sockets used. It is a percentage value between 0.1 and 1 (e.g., 0.8 = 80%) that indicates the capacity at which the fleet should create a new deployment for a specific policy when the previous deployment reaches this threshold.
It is essential to choose the threshold value carefully to avoid over-scaling and generating unnecessary costs. A lower threshold value will result in more frequent scaling, while a higher threshold value will result in fewer scaling events. To better understand deployment/session capacity, refer to the session capacity documentation.
Type: The type of policy will determine what kind of JSON
body will be valid in the data
field. It can either be:
Location
- The filters will be of geographical type like a city, country, continent, etc. This is the type you will most likely use.
Tag
- The filters will be based on in-house tags like infrastructure or CPU type. This is a more advanced way to filter your policy. You can get the available tags with the API Doc.
Coordinates
- This type allows you to input a latitude/longitude coordinates as the point where you want your deployments to be. We will try to make the deployments as close as possible to the coordinates.
Data: This field will vary depending on the type
. It will be a list of filters for Location
and Tag
. For the Point
type, it will be a dictionary with coordinates.
In the next section, we will go through every type
in detail and how to create the associated `data`.