「Extend App」のレプリカ上限とリソース割り当て
Overview
This article walks you through how to configure your Extend app's limit of replicas and allocation of CPU and and memory in the AccelByte Gaming Services (AGS) Admin Portal.
Configuration limits
Replicas
Each type of Extend app can have one up to 60 replicas.
Resources (CPU and memory)
Each Extend app type has its own range for allowed CPU and memory allocation considering the reserved resources for the internal component, as shown in the table below.
Type | Reserved CPU (Per VM) | Reserved CPU (Per Replica) | CPU Range | Reserved Memory (Per VM) | Reserved Memory (Per Replica) | Memory Range |
---|---|---|---|---|---|---|
Extend Override | 475 millicores | 110 millicores | 1 – 1,415 millicores | 1,498 MB | 120 MB | 1 – 2,382 MB |
Extend Service Extension | 475 millicores | 110 millicores | 1 – 1,415 millicores | 1,498 MB | 120 MB | 1 – 2,382 MB |
Extend Event Handler | 475 millicores | 310 millicores | 1 – 1,215 millicores | 1,498 MB | 1,144 MB | 1 – 1,358 MB |
Calculating CPU allocation for desired replicas
This example is only to demonstrate how to calculate the CPU allocation economically. Please also consider your own system needs for CPU, if your system need More CPU please allocate based on your own calculations.
This is an example how to calculate CPU for your app based on the number of replicas that you wish to be hosted in one VM
Given:
- Type: Extend Service Extension app
- Maximum Configurable CPU: 2,000 millicores
- Reserved CPU (Per VM): 475 millicores
- Reserved CPU (Per Replica): 110 millicores
- Number of Replicas to be hosted: 2
To calculate the needed configurable CPU per Extend app, follow these steps:
Calculate the reserved CPU for the replicas:
Reserved CPU (for replicas) = 110 millicores * 2 = 220 millicores
Calculate the total reserved CPU:
Total Reserved CPU = 475 millicores + 220 millicores = 695 millicores
Calculate the remaining configurable CPU:
Remaining Configurable CPU = 2,000 millicores - 695 millicores = 1,305 millicores
Calculate the configurable CPU per Extend app replica:
Configurable CPU per Extend App Replica= 1,305 millicores / 2 = 652.5 millicores
Therefore, the configurable CPU per Extend app is 652.5 millicores.
Calculating memory allocation for desired replicas
This example is only to demonstrate how to calculate the Memory allocation economically. Please also consider your own system needs for Memory, if your system need More Memory please allocate based on your own calculations.
This is an example how to calculate Memory for your app based on the number of replicas that you wish to be hosted in one VM
Given:
- Type: Extend Service Extension app
- Maximum Configurable Memory: 4,000 MiB
- Reserved Memory (Per VM): 1,498 MiB
- Reserved Memory (Per Replica): 120 MiB
- Number of Replicas to be hosted: 2
To calculate the needed configurable memory per Extend app, follow these steps:
Calculate the reserved memory for replicas:
Reserved Memory (for replicas) = 120 MiB * 2 = 240 MiB
Calculate the total reserved memory:
Total Reserved Memory = 1,498 MiB + 240 MiB = 1,738 MiB
Calculate the remaining configurable memory:
Remaining Configurable Memory = 4,000 MiB - 1,738 MiB = 2,262 MiB
Calculate the configurable memory per Extend app:
Configurable Memory per Extend App = 2,262 MiB / 2 = 1,131 MiB
Therefore, the configurable memory per Extend app is 1,131 MiB.
If the CPU and memory have different calculations on how many replicas a VM can host, the system will always follow the lower limit.
For example:
- Based on CPU (652.5 milicores), a VM can host 2 replicas.
- Based on Memory (2000 MB), a VM can host 1 replica. Since memory is the limiting factor, the system will allow only 1 replica per VM, even though the CPU could support more.
Configure replicas limit and resource allocation
To configure the replicas limit and resource allocation of an Extend app, follow these steps:
The CPU and memory allocation of an Extend app can also be configured during creation, on the Create New Extend app form. The resource allocation set during creation can later be adjusted, if needed.
On the AGS Admin Portal sidebar, go to Extend and select the Extend app menu where your app is in.
From the list of Extend apps, click on the name of the Extend app you want to update to open its details page.
At the top-right side of the details page, click on the settings button (gear icon). The Settings page appears.
On the Settings page of the Extend app, configure the replicas limit and resource allocation as needed:
- Replicas: adjust the minimum and maximum number of replicas the Extend app is allowed to have. The replicas limit can be up to 60 replicas.
- Resources
- CPU: adjust the Extend app's CPU allocation using millicores. Note that 1 CPU unit is equivalent to 1,000 millicores. For example, to allocate 0.5 of a CPU to the Extend app, set the value to 500 millicores.
- Memory: adjust the Extend app's memory allocation using MB.
Click Save to apply your changes.
warningIf the Extend app you're configuring is currently running, the app will automatically restart after you save your changes to apply them.